aboutsummaryrefslogtreecommitdiff
path: root/src/media-player-mpris.vala
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2015-03-26 10:56:49 -0500
committerTed Gould <ted@gould.cx>2015-03-26 10:56:49 -0500
commit8da8d520e32d6ca8be071a88cd3702644e07ace4 (patch)
treee1ca7f6621605a90c76225cbfb4b899f50a66d5a /src/media-player-mpris.vala
parentebd19de1c09b54e060ae1b327651558a7a694d53 (diff)
downloadayatana-indicator-sound-8da8d520e32d6ca8be071a88cd3702644e07ace4.tar.gz
ayatana-indicator-sound-8da8d520e32d6ca8be071a88cd3702644e07ace4.tar.bz2
ayatana-indicator-sound-8da8d520e32d6ca8be071a88cd3702644e07ace4.zip
Handle Vala incorrectly returning null for a non-null type
Diffstat (limited to 'src/media-player-mpris.vala')
-rw-r--r--src/media-player-mpris.vala4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/media-player-mpris.vala b/src/media-player-mpris.vala
index bf25e21..741d887 100644
--- a/src/media-player-mpris.vala
+++ b/src/media-player-mpris.vala
@@ -202,7 +202,7 @@ public class MediaPlayerMpris: MediaPlayer {
gproxy.g_properties_changed.connect (this.proxy_properties_changed);
this.notify_property ("is-running");
- this.state = this.proxy.PlaybackStatus;
+ this.state = this.proxy.PlaybackStatus != null ? this.proxy.PlaybackStatus : "Unknown";
this.update_current_track (gproxy.get_cached_property ("Metadata"));
if (this.play_when_attached) {
@@ -270,7 +270,7 @@ public class MediaPlayerMpris: MediaPlayer {
void proxy_properties_changed (DBusProxy proxy, Variant changed_properties, string[] invalidated_properties) {
if (changed_properties.lookup ("PlaybackStatus", "s", null)) {
- this.state = this.proxy.PlaybackStatus;
+ this.state = this.proxy.PlaybackStatus != null ? this.proxy.PlaybackStatus : "Unknown";
}
var metadata = changed_properties.lookup_value ("Metadata", new VariantType ("a{sv}"));