Skip to content
Browse files

guard against currentTrack=null in between track change

  • Loading branch information...
1 parent 3a934bb commit 5ca8142e4cd8d0a25f8c9e0e5e4a5b6bd37b08be @tonywok tonywok committed Apr 28, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 cocoa_spotify/SpotboxPlayer.m
View
4 cocoa_spotify/SpotboxPlayer.m
@@ -93,7 +93,9 @@ - (void) reportTrackProgress:(NSNotification *) notification {
NSString *trackPosition = [[NSString alloc] initWithFormat:@"%d", (long)pos];
NSString *currentTrack = [[[playbackManager currentTrack] spotifyURL] absoluteString];
- [self sendMessage:[NSString stringWithFormat:@"%@::%@::%@", @"spotbox:server::trackProgress", trackPosition, currentTrack]];
+ if (currentTrack && trackPosition) {
+ [self sendMessage:[NSString stringWithFormat:@"%@::%@::%@", @"spotbox:server::trackProgress", trackPosition, currentTrack]];
+ }
}
}

0 comments on commit 5ca8142

Please sign in to comment.
Something went wrong with that request. Please try again.