ali-rantakari / icalBuddy

Command-line utility for printing events and tasks from the OS X calendar database.
149 stars 33 forks source link

uncaught exception 'NSInvalidArgumentException' #24

Open wdanilo opened 5 years ago

wdanilo commented 5 years ago

Hi, I just installed icalBuddy and when running icalBuddy calendars from terminal on MacOS Catalina I get:

2019-06-16 00:59:50.732 icalBuddy[48349:511784] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'NSConcreteMutableAttributedString addAttribute:value:range:: nil value'
*** First throw call stack:
(
        0   CoreFoundation                      0x00007fff38f20c63 __exceptionPreprocess + 250
        1   libobjc.A.dylib                     0x00007fff6e3e906b objc_exception_throw + 48
        2   Foundation                          0x00007fff3b55fc87 +[NSPointerArray pointerArrayWithOptions:] + 0
        3   icalBuddy                           0x0000000101aed207 printAllCalendars + 569
        4   icalBuddy                           0x0000000101ae3842 main + 920
        5   libdyld.dylib                       0x00007fff6f7477a9 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
[1]    48349 abort      icalBuddy calendars
HIBIKI-CUBE commented 5 years ago

I got the same issue

vdsass commented 5 years ago

You may be getting this error due to OS X Privacy settings. Go to System Prefs > Security & Privacy. Pick Calendars on the left then make sure Terminal is enabled on the right.

andrefgneves commented 5 years ago

You may be getting this error due to OS X Privacy settings. Go to System Prefs > Security & Privacy. Pick Calendars on the left then make sure Terminal is enabled on the right.

This fixed the issue for me. Thanks @vdsass šŸ‘

adamyonk commented 5 years ago

I tried uninstalling and reinstalling ical-buddy, and tried invoking it from a few different apps (Terminal, iTerm, Hyper), and all of them are showing this error, all of them are in the Security allow lists. šŸ¤”

wdanilo commented 5 years ago

@vdsass I've already enabled the terminal access to calendars. I still have the same issue :(

gudezhi commented 5 years ago

I got a similar issue when running icalBuddy calendars, I also checked Security & Privacy setting but it does not help.

2019-09-12 18:32:39.983 icalBuddy[88741:837251] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'NSConcreteMutableAttributedString addAttribute:value:range:: nil value'
*** First throw call stack:
(
    0   CoreFoundation                      0x00007fff39baf6f3 __exceptionPreprocess + 250
    1   libobjc.A.dylib                     0x00007fff6f81dbd4 objc_exception_throw + 48
    2   Foundation                          0x00007fff3c1fc324 +[NSPointerArray pointerArrayWithOptions:] + 0
    3   icalBuddy                           0x000000010cee6207 printAllCalendars + 569
    4   icalBuddy                           0x000000010cedc842 main + 920
    5   libdyld.dylib                       0x00007fff70b7a2a5 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
fish: 'icalBuddy calendars' terminated by signal SIGABRT (Abort)
oscarmorrison commented 4 years ago

Also getting this same issue "NSInvalidArgumentException" Calendar enable in privacy settings

mdbraber commented 4 years ago

Same issue here. It seems that there's a problem with how arguments are parsed. E.g. icalBuddy eventsNow works as expected, icalBuddy eventsToday+1 doesn't work.

borna761 commented 4 years ago

This repo hasn't been touched in 5-6 years, is there any hope that this is going to be fixed?

andriichernenko commented 4 years ago

This crash can be fixed by adding [[event calendar] color] != nil to the if statement condition at icalBuddyPrettyPrint.m:626.

borna761 commented 4 years ago

Can someone please make a 64-bit binary with the above fix or show me how to make one?

khandelwalpiyush commented 4 years ago

Same issue after upgrading to Catalina and on v1.9.0. Reset calendar and reminder permissions. No command works... Hopefully someone can fix it?

gvmelle commented 4 years ago

I got this when running: /usr/local/bin/icalBuddy -df %d-%b-%Y -sd -sc -nc -n -nrd -eep "notes, url" eventsToday+7 on iMac with macOS 10.15. All permissions set for disk access and Calendar. 2019-10-13 11:20:47.683 icalBuddy[18692:175558] Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'NSConcreteMutableAttributedString addAttribute:value:range:: nil value' First throw call stack: ( 0 CoreFoundation 0x00007fff3c97ad63 __exceptionPreprocess + 250 1 libobjc.A.dylib 0x00007fff72869bd4 objc_exception_throw + 48 2 Foundation 0x00007fff3efd81a4 +[NSPointerArray pointerArrayWithOptions:] + 0 3 icalBuddy 0x000000010000ca7b printItemSections + 331 4 icalBuddy 0x0000000100002400 main + 1456 5 icalBuddy 0x0000000100001de4 start + 52 6 ??? 0x000000000000000b 0x0 + 11 ) libc++abi.dylib: terminating with uncaught exception of type NSException Abort trap: 6

mdbraber commented 4 years ago

Thanks to @andriichernenko's comment I've been able to fix this in my fork from @DavidKaluta https://github.com/mdbraber/icalBuddy64. See commit: https://github.com/mdbraber/icalBuddy64/commit/1d7fea87283e1b333eb258fd3ecc09da85102ce4

@DavidKaluta has updated his fork to release v1.10.0 https://github.com/DavidKaluta/icalBuddy64/releases/tag/v1.10.0

If anybody knows how to get the homebrew formula updated to include these fixes, let me know! https://github.com/Homebrew/homebrew-core/blob/master/Formula/ical-buddy.rb

Btw - I haven't extensively tested this, so let me know if this still doesn't work for you. For now icalBuddy calendars and icalBuddy eventsToday+2 work e.g.

gvmelle commented 4 years ago

still an error with version 10.0: /usr/local/bin/icalBuddy -df %d-%b-%Y -sd -sc -nc -n -nrd -eep "notes, url" eventsToday+7 2019-10-13 20:12:03.350 icalBuddy[62434:708355] Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'NSConcreteMutableAttributedString addAttribute:value:range:: nil value' First throw call stack: ( 0 CoreFoundation 0x00007fff3c97ad63 __exceptionPreprocess + 250 1 libobjc.A.dylib 0x00007fff72869bd4 objc_exception_throw + 48 2 Foundation 0x00007fff3efd81a4 +[NSPointerArray pointerArrayWithOptions:] + 0 3 icalBuddy 0x000000010000bafb printItemSections + 331 4 icalBuddy 0x000000010000150d main + 1453 5 icalBuddy 0x0000000100000ef4 start + 52 6 ??? 0x000000000000000b 0x0 + 11 ) libc++abi.dylib: terminating with uncaught exception of type NSException Abort trap: 6

khandelwalpiyush commented 4 years ago

@mdbraber @DavidKaluta v1.10.0 works for me for my simple commands.. Thanks

borna761 commented 4 years ago

Can confirm the changes work for me as well, thank you so much!

mdbraber commented 4 years ago

@gvmelle please try releasee 1.9.2 and see if that fixes your problems (works here) https://github.com/mdbraber/icalBuddy64/releases/tag/v1.9.2.

gvmelle commented 4 years ago

1.9.2 worked for me!!