summaryrefslogtreecommitdiff
path: root/indra/llwindow/llopenglview-objc.mm
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llwindow/llopenglview-objc.mm')
-rw-r--r--indra/llwindow/llopenglview-objc.mm7
1 files changed, 6 insertions, 1 deletions
diff --git a/indra/llwindow/llopenglview-objc.mm b/indra/llwindow/llopenglview-objc.mm
index 049226db65..7936245744 100644
--- a/indra/llwindow/llopenglview-objc.mm
+++ b/indra/llwindow/llopenglview-objc.mm
@@ -495,7 +495,12 @@ attributedStringInfo getSegments(NSAttributedString *str)
// e.g. OS Window for upload something or Input Window...
// mModifiers instance variable is for insertText: or insertText:replacementRange: (by Pell Smit)
mModifiers = [theEvent modifierFlags];
- unichar ch = [[theEvent charactersIgnoringModifiers] characterAtIndex:0];
+ NSString *str_no_modifiers = [theEvent charactersIgnoringModifiers];
+ unichar ch = 0;
+ if (str_no_modifiers.length)
+ {
+ ch = [str_no_modifiers characterAtIndex:0];
+ }
bool acceptsText = mHasMarkedText ? false : callKeyDown(&eventData, keycode, mModifiers, ch);
if (acceptsText &&