Skip to content
This repository has been archived by the owner on Jul 26, 2022. It is now read-only.

Commit

Permalink
fix NPE when adding tracks to empty playlist
Browse files Browse the repository at this point in the history
  • Loading branch information
scorpp committed Apr 5, 2014
1 parent 2c11262 commit 1f2b1f6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion vkontakte.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,9 @@ vk_add_tracks_from_tree_model_to_playlist (GtkTreeModel *treemodel, GList *gtk_t
gtk_tree_path_list = g_list_previous (gtk_tree_path_list);
}

deadbeef->pl_item_unref (last);
if (last) {
deadbeef->pl_item_unref (last);
}
}

deadbeef->plt_add_files_end (plt, 0);
Expand Down Expand Up @@ -397,6 +399,7 @@ vk_ddb_vfs_get_schemes () {

static void
vk_vfs_store_track (VkAudioTrack *track, int index, DB_FILE **f) {
trace ("vk_vfs_store_track: %s, index=%d\n", track->url, index);
if (index == 0) {
// TODO ensure URL is of supported scheme
*f = deadbeef->fopen (track->url);
Expand Down

0 comments on commit 1f2b1f6

Please sign in to comment.