MacPaw/XADMaster

crash with `unar -q`

ci-macpaw opened this issue · 0 comments

kharlamov NA (kharlamov):

Suppose that in some dir I already have foo.tar.xz and have uncompressed it to yield the folder foo. Now, if I forgot that there's already a folder with the same name that unar will try to give the result of uncompressing foo.tar.xz, and thus do unar -q foo.tar.xz, then unar will crash

 *** Terminating app due to uncaught e
xception 'NSInvalidArgumentException', reason: '*** -[NSPlaceholderMutableString
 initWithString:]: nil argument'
*** First throw call stack:
(
        0   CoreFoundation                      0x00007fffa2da16fb __exceptionPr
eprocess + 171
        1   libobjc.A.dylib                     0x00007fffb75a8a2a objc_exceptio
n_throw + 48
        2   CoreFoundation                      0x00007fffa2e1e9a5 +[NSException
 raise:format:] + 197
        3   Foundation                          0x00007fffa471d53d -[NSPlacehold
erMutableString initWithString:] + 96
        4   Foundation                          0x00007fffa475ae24 +[NSString st
ringWithString:] + 45
        5   unar                                0x000000010000571d unar + 22301
        6   unar                                0x0000000100002718 unar + 10008
        7   unar                                0x00000001000a25c9 unar + 665033

        8   unar                                0x00000001000022a7 unar + 8871
        9   unar                                0x00000001000018d4 unar + 6356
)
libc++abi.dylib: terminating with uncaught exception of type NSException

Command terminated

There is no crash if the -q flag is left off. I think that unar -q should just assume that it if there is already a relevantly-named folder present, it should append a digit like TheUnarchiver.app does and like unar (without -q) does when you choose "(R)ename".