Add a nil check to prevent a crash
This commit is contained in:
Родитель
87a8f43014
Коммит
57c8333ddc
|
@ -493,7 +493,7 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithFrame:(CGRect)frame)
|
|||
|
||||
if (range.location + range.length > backedTextInputView.attributedText.string.length) {
|
||||
_predictedText = backedTextInputView.attributedText.string;
|
||||
} else {
|
||||
} else if (text != nil) { // TODO(macOS GH#774): -[NSString stringByReplacingCharactersInRange:withString:] doesn't like when the replacement string is nil
|
||||
_predictedText = [backedTextInputView.attributedText.string stringByReplacingCharactersInRange:range withString:text];
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче