julienXX / terminal-notifier

Send User Notifications on macOS from the command-line.
Other
6.37k stars 330 forks source link

uncaught exception using -dropdownLabel #228

Closed voldemortensen closed 7 years ago

voldemortensen commented 7 years ago

Please check everything that applies to your issue:

macOS: 10.12.5 terminal-notifier version: 1.8.0 Installed with homebrew.

Steps to reproduce:

  1. run command from README.md terminal-notifier -message "Deploy now on UAT ?" -actions Now,"Later today","Tomorrow" -dropdownLabel "When ?"
  2. Hover over notification to get the "When ?" label to appear.
  3. Click dropdown.
  4. See uncaught exception.
2017-06-10 15:44:28.768 terminal-notifier[54111:765454] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayI objectAtIndex:]: index 9223372036854775807 beyond bounds [0 .. 2]'
*** First throw call stack:
(
    0   CoreFoundation                      0x00007fff8db2a2cb __exceptionPreprocess + 171
    1   libobjc.A.dylib                     0x00007fffa293548d objc_exception_throw + 48
    2   CoreFoundation                      0x00007fff8da4d04c -[__NSArrayI objectAtIndex:] + 156
    3   terminal-notifier                   0x000000010fc82a65 -[AppDelegate userNotificationCenter:didActivateNotification:] + 573
    4   Foundation                          0x00007fff8f776125 -[_NSConcreteUserNotificationCenter _sendDelegateMessage:sendToAppDelegate:withObject:] + 135
    5   Foundation                          0x00007fff8f7763a4 -[_NSConcreteUserNotificationCenter _notificationClickedMessage:] + 572
    6   Foundation                          0x00007fff8f776a1b __54-[_NSConcreteUserNotificationCenter _serverConnection]_block_invoke.275 + 287
    7   libdispatch.dylib                   0x00007fffa31ed524 _dispatch_call_block_and_release + 12
    8   libdispatch.dylib                   0x00007fffa31e48fc _dispatch_client_callout + 8
    9   libdispatch.dylib                   0x00007fffa31f1aac _dispatch_main_queue_callback_4CF + 925
    10  CoreFoundation                      0x00007fff8dadfbc9 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
    11  CoreFoundation                      0x00007fff8daa0c0d __CFRunLoopRun + 2205
    12  CoreFoundation                      0x00007fff8daa0114 CFRunLoopRunSpecific + 420
    13  HIToolbox                           0x00007fff8d001ebc RunCurrentEventLoopInMode + 240
    14  HIToolbox                           0x00007fff8d001cf1 ReceiveNextEventCommon + 432
    15  HIToolbox                           0x00007fff8d001b26 _BlockUntilNextEventMatchingListInModeWithFilter + 71
    16  AppKit                              0x00007fff8b59aa54 _DPSNextEvent + 1120
    17  AppKit                              0x00007fff8bd167ee -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 2796
    18  AppKit                              0x00007fff8b58f3db -[NSApplication run] + 926
    19  terminal-notifier                   0x000000010fc83c48 main + 152
    20  libdyld.dylib                       0x00007fffa321a235 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Abort trap: 6
voldemortensen commented 7 years ago

I don't know much ruby and no objective-c or I'd more than happy to dig into this.

julienXX commented 7 years ago

@voldemortensen this happens when your notifications are not configured to use the alert style as stated is the Caveats section of the README. Just change the alert style to "Alerts" and you should not see this any longer.

voldemortensen commented 7 years ago

Oh, duh. The one with the big giant picture. Of course I miss that one. Sorry about that :) And thanks for a great tool!