SubmarinerApp / Submariner

A Subsonic client for macOS
https://submarinerapp.com
BSD 3-Clause "New" or "Revised" License
123 stars 3 forks source link

Error on 2.2 release #129

Closed Porco-Rosso closed 1 year ago

Porco-Rosso commented 1 year ago

I'm getting the following crash on playing songs from a remote server since updating to 2.2

Exception Name: NSInvalidArgumentException
Description: *** -[__NSDictionaryM setObject:forKey:]: object cannot be nil (key: albumTitle)
User Info: (null)

0   CoreFoundation                      0x0000000194a6b3f8 __exceptionPreprocess + 176
1   libobjc.A.dylib                     0x00000001945b6ea8 objc_exception_throw + 60
2   CoreFoundation                      0x0000000194b50ca4 -[__NSCFString characterAtIndex:].cold.1 + 0
3   CoreFoundation                      0x0000000194b5dde0 -[__NSDictionaryM setObject:forKey:].cold.3 + 0
4   CoreFoundation                      0x00000001949ac124 -[__NSDictionaryM setObject:forKey:] + 840
5   Submariner                          0x00000001022c0d34 Submariner + 183604
6   Submariner                          0x00000001022c128c Submariner + 184972
7   Submariner                          0x00000001022c1388 Submariner + 185224
8   Submariner                          0x00000001022c2380 Submariner + 189312
9   Submariner                          0x00000001022c2998 Submariner + 190872
10  CoreFoundation                      0x00000001949e5570 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 148
11  CoreFoundation                      0x0000000194a83054 ___CFXRegistrationPost_block_invoke + 88
12  CoreFoundation                      0x0000000194a82f9c _CFXRegistrationPost + 440
13  CoreFoundation                      0x00000001949b6b74 _CFXNotificationPost + 708
14  AVFCore                             0x00000001a7c2c934 __avplayeritem_fpItemNotificationCallback_block_invoke + 5004
15  libdispatch.dylib                   0x00000001947889dc _dispatch_call_block_and_release + 32
16  libdispatch.dylib                   0x000000019478a504 _dispatch_client_callout + 20
17  libdispatch.dylib                   0x0000000194798d1c _dispatch_main_queue_drain + 928
18  libdispatch.dylib                   0x000000019479896c _dispatch_main_queue_callback_4CF + 44
19  CoreFoundation                      0x0000000194a31d50 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16
20  CoreFoundation                      0x00000001949ef7d0 __CFRunLoopRun + 2036
21  CoreFoundation                      0x00000001949ee888 CFRunLoopRunSpecific + 612
22  HIToolbox                           0x000000019e0c3fa0 RunCurrentEventLoopInMode + 292
23  HIToolbox                           0x000000019e0c3de4 ReceiveNextEventCommon + 672
24  HIToolbox                           0x000000019e0c3b2c _BlockUntilNextEventMatchingListInModeWithFilter + 72
25  AppKit                              0x0000000197c70424 _DPSNextEvent + 632
26  AppKit                              0x0000000197c6f5b4 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 728
27  AppKit                              0x0000000197c639e4 -[NSApplication run] + 464
28  AppKit                              0x0000000197c3ae28 NSApplicationMain + 880
29  dyld                                0x00000001945e7e50 start + 2544
NattyNarwhal commented 1 year ago

Problem is here: https://github.com/NattyNarwhal/Submariner/blob/master/Submariner/SBPlayer.m#L211

I think the album name of the file you're trying to play is nil, and it seems that MPNowPlayingInfoCenter really does not like that. It seems we have to basically wrap anything that could be nil, or just not set it if so.

NattyNarwhal commented 1 year ago

Should be fixed in ef6b469