Check pointer before derefencing (fixes #2161)

current_track may be uninialized when this function is called at load-time
This commit is contained in:
Alexander van Gessel 2017-11-02 21:48:53 +01:00
parent ba3c6ec3da
commit ee5a6e03f4

View file

@ -714,7 +714,7 @@ void play_music_config(const config& music_node, int i)
current_track = *iter;
current_track_index = iter - current_track_list.begin();
play_music();
} else if(!track.append()) { // Make sure the current track is finished
} else if(!track.append() && current_track) { // Make sure the current track is finished
current_track->set_play_once(true);
}
}