Skip to content

Commit 35f2ca3

Browse files
committed
fix(ios): nil pointer handling
1 parent c5008f0 commit 35f2ca3

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

ios/styles/OrderedListStyle.mm

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,9 @@ - (void)applyIndentForListRange:(NSRange)listRange
121121
existing.firstLineHeadIndent == listHeadIndent) {
122122
return;
123123
}
124-
NSMutableParagraphStyle *pStyle = [existing mutableCopy];
124+
NSMutableParagraphStyle *pStyle =
125+
existing ? [existing mutableCopy]
126+
: [[NSMutableParagraphStyle alloc] init];
125127
pStyle.headIndent = listHeadIndent;
126128
pStyle.firstLineHeadIndent = listHeadIndent;
127129
[self.host.textView.textStorage

0 commit comments

Comments
 (0)