Skip to content
This repository has been archived by the owner on Mar 12, 2023. It is now read-only.

Commit

Permalink
fix wrong null checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Lamby committed Dec 6, 2014
1 parent 15267f8 commit 03df1c8
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/mprisServer.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,14 +163,13 @@ GVariant* getMetadataForTrack(int track_id, DB_functions_t *deadbeef) {

const char *title = deadbeef->pl_find_meta(track, "title");
debug("get Metadata title: %s", title);
if (date != NULL) {
if (title != NULL) {
g_variant_builder_add(builder, "{sv}", "xesam:title", g_variant_new("s", title));
//free((char*)title);
}

const char *trackNumber = deadbeef->pl_find_meta(track, "track");
debug("get Metadata trackNumber: %s", trackNumber);
if (date != NULL) {
if (trackNumber != NULL) {
int trackNumberAsInt = atoi(trackNumber);
if (trackNumberAsInt > 0) {
g_variant_builder_add(builder, "{sv}", "xesam:trackNumber", g_variant_new("q", trackNumberAsInt));
Expand Down

0 comments on commit 03df1c8

Please sign in to comment.