spotify/cocoalibspotify — Issue #24: Crash bug in SPSession
Author: sshrpe
Created: 2011-11-25 11:15:32+00:00
State: open

I just merged the latest 'Experimental/ARC' branch, and my app started crashing out as soon as the SPSession finishes loading. I traced the problem to this line in SPSession (line 573):

```objectivec
for (SPTrack *track in someTracks)
[track setStarredFromLibSpotifyUpdate:sp_track_is_starred(self.session, track.track)];
```

Seems some of the tracks in someTracks were being returned as SPPlaylistItem objects, and the call to -track was making the app crash. I've changed it to this which seems to work for now:

```objc
for (SPTrack *track in someTracks) {
if ([track isKindOfClass:[SPTrack class]]) {
[track setStarredFromLibSpotifyUpdate:sp_track_is_starred(self.session, track.track)];
}
}
```