]> granicus.if.org Git - handbrake/commitdiff
MacGui: check if there is at least one character in the string before trying to get...
authorDamiano Galassi <damiog@gmail.com>
Wed, 24 Feb 2016 07:54:36 +0000 (08:54 +0100)
committerDamiano Galassi <damiog@gmail.com>
Wed, 24 Feb 2016 07:54:36 +0000 (08:54 +0100)
macosx/HBQueueController.mm

index 19fc8a37ac492c78c87aacd18a1b388d23e084d1..8cada21dd521f3e43d1cdabd762b6bad1c7a0c4c 100644 (file)
 {
     id delegate = [self delegate];
 
-    unichar key = [[event charactersIgnoringModifiers] characterAtIndex:0];
+    unichar key = 0;
+    NSString *characters = [event charactersIgnoringModifiers];
+    if (characters.length)
+    {
+        key = [characters characterAtIndex:0];
+    }
+
     if ((key == NSDeleteCharacter || key == NSDeleteFunctionKey) &&
                [delegate respondsToSelector:@selector(removeSelectedQueueItem:)])
     {