diff --git a/indra/llwindow/llopenglview-objc.mm b/indra/llwindow/llopenglview-objc.mm
index 9d497691d814230d03e79aea8606f056235de893..586e00b5e48a8cd9c50f86b072b3ddd47ef76d48 100644
--- a/indra/llwindow/llopenglview-objc.mm
+++ b/indra/llwindow/llopenglview-objc.mm
@@ -550,7 +550,16 @@ attributedStringInfo getSegments(NSAttributedString *str)
     if (mModifiers & mask)
     {
         eventData.mKeyEvent = NativeKeyEventData::KEYDOWN;
-        callKeyDown(&eventData, [theEvent keyCode], 0, [[theEvent characters] characterAtIndex:0]);
+
+        wchar_t c = 0;
+        if([theEvent type] == NSEventTypeKeyDown)
+        {
+            // characters property is only valid when the event is of type KeyDown or KeyUp
+            // https://developer.apple.com/documentation/appkit/nsevent/1534183-characters?language=objc
+            c = [[theEvent characters] characterAtIndex:0];
+        }
+
+        callKeyDown(&eventData, [theEvent keyCode], 0, c);
     }
     else
     {