forked from firka/flutter
Add null check in FLETextInputPlugin (flutter/engine#8538)
Adds a guard on `_activeClientID` in `insertNewline:`. The conditional around the `insertText:replacementRange:` call already catches this, but we then unconditionally pack `_activeClientID` into an `NSArray`, which disallows nil.
This commit is contained in:
@@ -242,11 +242,13 @@ static NSString* const kMultilineInputType = @"TextInputType.multiline";
|
||||
}
|
||||
|
||||
- (void)insertNewline:(id)sender {
|
||||
if ([self.activeModel.inputType isEqualToString:kMultilineInputType]) {
|
||||
[self insertText:@"\n" replacementRange:self.activeModel.selectedRange];
|
||||
if (self.activeModel != nil) {
|
||||
if ([self.activeModel.inputType isEqualToString:kMultilineInputType]) {
|
||||
[self insertText:@"\n" replacementRange:self.activeModel.selectedRange];
|
||||
}
|
||||
[_channel invokeMethod:kPerformAction
|
||||
arguments:@[ _activeClientID, self.activeModel.inputAction ]];
|
||||
}
|
||||
[_channel invokeMethod:kPerformAction
|
||||
arguments:@[ _activeClientID, self.activeModel.inputAction ]];
|
||||
}
|
||||
|
||||
- (void)setMarkedText:(id)string
|
||||
|
||||
Reference in New Issue
Block a user