aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2011-10-26 12:28:59 -0400
committerConor Curran <conor.curran@canonical.com>2011-10-26 12:28:59 -0400
commit8bde3f5a65575a9df08e06c7d14cc00ba86cc731 (patch)
treef81c370908db5dee891c6ddcc9e7aa97b425997d /src
parent2d85ce77dba8f72869788093a8197c151ea899ce (diff)
downloadayatana-indicator-sound-8bde3f5a65575a9df08e06c7d14cc00ba86cc731.tar.gz
ayatana-indicator-sound-8bde3f5a65575a9df08e06c7d14cc00ba86cc731.tar.bz2
ayatana-indicator-sound-8bde3f5a65575a9df08e06c7d14cc00ba86cc731.zip
protect against rogue mpris or desktop name keys
Diffstat (limited to 'src')
-rw-r--r--src/music-player-bridge.vala5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/music-player-bridge.vala b/src/music-player-bridge.vala
index 0c9cb10..e7bc1fb 100644
--- a/src/music-player-bridge.vala
+++ b/src/music-player-bridge.vala
@@ -229,14 +229,13 @@ public class MusicPlayerBridge : GLib.Object
{
var result = desktop_or_interface;
var tokens = desktop_or_interface.split( "." );
- if ( tokens.length > 1 ){
+ if (tokens != null && tokens.length > 1){
result = tokens[tokens.length - 1];
}
var temp = result.split("-");
- if (temp.length > 1){
+ if (temp != null && temp.length > 1){
result = temp[0];
}
- debug("determine key result = %s", result);
return result;
}