mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
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:
parent
5d2a294ba2
commit
e7bd1767be
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user