diff options
author | Damiano Galassi <[email protected]> | 2016-02-23 09:36:47 +0100 |
---|---|---|
committer | Damiano Galassi <[email protected]> | 2016-02-23 09:36:47 +0100 |
commit | a8242552c097c713028fae120699ee2783130491 (patch) | |
tree | 825c4c1960f86dbfd9b5f81373bdb7deacc6fc6e /macosx/HBQueueOutlineView.m | |
parent | 079242c20dcef93cc4dd71a152c6e8b2a5a278e3 (diff) |
MacGui: check if there is at least one character in the string before trying to get the first character in HBQueueOutlineView.
Diffstat (limited to 'macosx/HBQueueOutlineView.m')
-rw-r--r-- | macosx/HBQueueOutlineView.m | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/macosx/HBQueueOutlineView.m b/macosx/HBQueueOutlineView.m index 53e7a3fac..0c7bce87f 100644 --- a/macosx/HBQueueOutlineView.m +++ b/macosx/HBQueueOutlineView.m @@ -45,24 +45,26 @@ { id delegate = [self delegate]; - unichar key = [[event charactersIgnoringModifiers] characterAtIndex:0]; - if ((key == NSDeleteCharacter || key == NSDeleteFunctionKey) && - [delegate respondsToSelector:@selector(HB_deleteSelectionFromTableView:)]) + NSString *characters = [event charactersIgnoringModifiers]; + if (characters.length) { - if ([self selectedRow] == -1) + unichar key = [characters characterAtIndex:0]; + if ((key == NSDeleteCharacter || key == NSDeleteFunctionKey) && + [delegate respondsToSelector:@selector(HB_deleteSelectionFromTableView:)]) { - NSBeep(); + if ([self selectedRow] == -1) + { + NSBeep(); + } + else + { + [delegate HB_deleteSelectionFromTableView:self]; + } + return; } - else - { - [delegate HB_deleteSelectionFromTableView:self]; - } - return; - } - else - { - [super keyDown:event]; } + + [super keyDown:event]; } /** |