aboutsummaryrefslogtreecommitdiff
path: root/src/media-player-list-greeter.vala
diff options
context:
space:
mode:
authorRobert Tari <robert@tari.in>2021-03-09 00:32:56 +0100
committerRobert Tari <robert@tari.in>2021-08-04 21:42:10 +0200
commit8df9168f5587cfd31e0bf6a4170a4c4f9784dbb7 (patch)
tree79a6b0b0a2b87e94bb7c727bb9a3a0cde2ad3a29 /src/media-player-list-greeter.vala
parent6bf50a40c9dc25ae33878d246a74ffc5106dd4a5 (diff)
downloadayatana-indicator-sound-8df9168f5587cfd31e0bf6a4170a4c4f9784dbb7.tar.gz
ayatana-indicator-sound-8df9168f5587cfd31e0bf6a4170a4c4f9784dbb7.tar.bz2
ayatana-indicator-sound-8df9168f5587cfd31e0bf6a4170a4c4f9784dbb7.zip
Avoid possible null value
Diffstat (limited to 'src/media-player-list-greeter.vala')
-rw-r--r--src/media-player-list-greeter.vala9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/media-player-list-greeter.vala b/src/media-player-list-greeter.vala
index fb57597..1357e38 100644
--- a/src/media-player-list-greeter.vala
+++ b/src/media-player-list-greeter.vala
@@ -45,8 +45,13 @@ public class MediaPlayerListGreeter : MediaPlayerList {
this.proxy.entry_selected.connect(active_user_changed);
this.proxy.get_active_entry.begin ((obj, res) => {
try {
- var value = (obj as AyatanaGreeterList).get_active_entry.end(res);
- active_user_changed(value);
+ var list = (obj as AyatanaGreeterList);
+
+ if (list != null)
+ {
+ var value = list.get_active_entry.end(res);
+ active_user_changed(value);
+ }
} catch (Error e) {
warning("Unable to get active entry: %s", e.message);
}