diff --git a/src/itdb_sqlite.c b/src/itdb_sqlite.c index 5f05b57..ecfa5f3 100644 --- a/src/itdb_sqlite.c +++ b/src/itdb_sqlite.c @@ -637,9 +637,11 @@ static void mk_Library(Itdb_iTunesDB *itdb, else sqlite3_bind_int(stmt, ++idx, 0); /* album_pid -7670716306765259718 */ - this_album = g_hash_table_lookup(album_ids, track); - if (this_album) { - album_pid = this_album->sql_id; + if (track->album) { + this_album = g_hash_table_lookup(album_ids, track); + if (this_album) { + album_pid = this_album->sql_id; + } } sqlite3_bind_int64(stmt, ++idx, album_pid); /* artist_pid -7576753259813584028 */