Merge lp:~rockstar/ubuntuone-ios-music/fix-crasher into lp:ubuntuone-ios-music

Proposed by Paul Hummer
Status: Merged
Approved by: Paul Hummer
Approved revision: 256
Merged at revision: 256
Proposed branch: lp:~rockstar/ubuntuone-ios-music/fix-crasher
Merge into: lp:ubuntuone-ios-music
Diff against target: 16 lines (+2/-1)
1 file modified
Music/Utilities/UOPlayer.m (+2/-1)
To merge this branch: bzr merge lp:~rockstar/ubuntuone-ios-music/fix-crasher
Reviewer Review Type Date Requested Status
Brian Curtin (community) Approve
Review via email: mp+148359@code.launchpad.net

Commit message

Fix a crash in NowPlayingInfoCenter

Description of the change

Crashlytics reported this crash not long after I put out (and then removed) a TestFlight build.

To post a comment you must log in.
Revision history for this message
Brian Curtin (brian.curtin) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Music/Utilities/UOPlayer.m'
2--- Music/Utilities/UOPlayer.m 2013-02-13 20:32:27 +0000
3+++ Music/Utilities/UOPlayer.m 2013-02-14 02:20:28 +0000
4@@ -280,11 +280,12 @@
5
6 - (void)songChanged {
7 Song *song = [[self currentPlaylist] objectAtIndex:self.currentIndex];
8+ UIImage *artwork = song.art != nil ? song.art : [UIImage imageNamed:@"default-album-art-640.png"];
9 NSDictionary *songInfo = @{MPMediaItemPropertyAlbumTitle: song.album.title,
10 MPMediaItemPropertyAlbumTrackCount: [NSNumber numberWithInt:[song.album.songs count]],
11 MPMediaItemPropertyAlbumTrackNumber: [NSNumber numberWithInt:song.track],
12 MPMediaItemPropertyAlbumArtist: song.albumArtist ? song.albumArtist.name : song.artist.name,
13- MPMediaItemPropertyArtwork: [[MPMediaItemArtwork alloc] initWithImage:song.art],
14+ MPMediaItemPropertyArtwork: [[MPMediaItemArtwork alloc] initWithImage:artwork],
15 MPMediaItemPropertyPlaybackDuration: [NSNumber numberWithInt:song.duration],
16 MPMediaItemPropertyTitle: song.title,
17

Subscribers

People subscribed via source and target branches