Permalink
Browse files

Add missing null check in Track.album (fix #12)

  • Loading branch information...
1 parent 92ac828 commit 8cd7c9279222ff792e02c7702333445894bee771 @bok bok committed Jun 1, 2011
Showing with 2 additions and 0 deletions.
  1. +2 −0 src/track.c
View
@@ -68,6 +68,8 @@ static PyObject *Track_album(Track *self) {
sp_album *album;
album = sp_track_album(self->_track);
+ if (!album)
+ Py_RETURN_NONE;
Album *a = (Album *)PyObject_CallObject((PyObject *)&AlbumType, NULL);
sp_album_add_ref(album);
a->_album = album;

0 comments on commit 8cd7c92

Please sign in to comment.