diff options
author | Ted Gould <ted@gould.cx> | 2014-10-01 11:02:29 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2014-10-01 11:02:29 -0500 |
commit | 6f911c1d1ea7caa5031271eb9f2a3d295c492edc (patch) | |
tree | 5b95f9a6bf8ec5fa3a34acca8e10c22cfb547ea1 | |
parent | 1405aaf129611fbbe66e57cd0b95c41352f60c6e (diff) | |
download | ayatana-indicator-sound-6f911c1d1ea7caa5031271eb9f2a3d295c492edc.tar.gz ayatana-indicator-sound-6f911c1d1ea7caa5031271eb9f2a3d295c492edc.tar.bz2 ayatana-indicator-sound-6f911c1d1ea7caa5031271eb9f2a3d295c492edc.zip |
Make it so that metadata can be NULL and handle it.
-rw-r--r-- | src/media-player-mpris.vala | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/media-player-mpris.vala b/src/media-player-mpris.vala index 25ddac4..80b9ac1 100644 --- a/src/media-player-mpris.vala +++ b/src/media-player-mpris.vala @@ -274,8 +274,7 @@ public class MediaPlayerMpris: MediaPlayer { } var metadata = changed_properties.lookup_value ("Metadata", new VariantType ("a{sv}")); - if (metadata != null) - this.update_current_track (metadata); + this.update_current_track (metadata); } void playlists_proxy_properties_changed (DBusProxy proxy, Variant changed_properties, string[] invalidated_properties) { @@ -283,7 +282,7 @@ public class MediaPlayerMpris: MediaPlayer { this.fetch_playlists (); } - void update_current_track (Variant metadata) { + void update_current_track (Variant? metadata) { if (metadata != null) { this.current_track = new Track ( sanitize_metadata_value (metadata.lookup_value ("xesam:artist", null)), |