macOS: handle the OS calling insertText: with a nil string
Fixes #10152
This commit is contained in:
parent
65e6a127ff
commit
1dc3730782
1 changed files with 4 additions and 0 deletions
|
|
@ -2023,6 +2023,10 @@ - (NSRect)firstRectForCharacterRange:(NSRange)range
|
|||
|
||||
- (void)insertText:(id)string replacementRange:(NSRange)replacementRange
|
||||
{
|
||||
if (!string) {
|
||||
debug_input("\n\tinsertText: nil replacementRange: (%lu, %lu)\n", replacementRange.location, replacementRange.length);
|
||||
return;
|
||||
}
|
||||
const char *utf8 = polymorphic_string_as_utf8(string);
|
||||
debug_input("\n\tinsertText: %s replacementRange: (%lu, %lu)\n", utf8, replacementRange.location, replacementRange.length);
|
||||
if ([self hasMarkedText] && !is_ascii_control_char(utf8[0])) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue