aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2013-10-28 19:43:14 +0000
committerTarmac <Unknown>2013-10-28 19:43:14 +0000
commita440eb1df8296a6b431613ec03aac94db38292c6 (patch)
treed2596dac0ac8a68f0efdbffa4b3f6844fc6832d4 /src
parentc2533b50fa2a1448f510038de902fe0d594b7f99 (diff)
parent9ebfd4a45a13d55f8f926f3a97a6479cd8e4671c (diff)
downloadayatana-indicator-sound-a440eb1df8296a6b431613ec03aac94db38292c6.tar.gz
ayatana-indicator-sound-a440eb1df8296a6b431613ec03aac94db38292c6.tar.bz2
ayatana-indicator-sound-a440eb1df8296a6b431613ec03aac94db38292c6.zip
Test that MediaPlayer's icon property isn't NULL before we serialize it. Fixes: https://bugs.launchpad.net/bugs/1229612.
Approved by PS Jenkins bot, Lars Uebernickel.
Diffstat (limited to 'src')
-rw-r--r--src/sound-menu.vala8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/sound-menu.vala b/src/sound-menu.vala
index e1c5c1f..f3f4fd9 100644
--- a/src/sound-menu.vala
+++ b/src/sound-menu.vala
@@ -141,10 +141,16 @@ class SoundMenu: Object
void insert_player_section (MediaPlayer player) {
var section = new Menu ();
+ Icon icon;
+
+ icon = player.icon;
+ if (icon == null)
+ icon = new ThemedIcon.with_default_fallbacks ("application-default-icon");
var player_item = new MenuItem (player.name, "indicator." + player.id);
player_item.set_attribute ("x-canonical-type", "s", "com.canonical.unity.media-player");
- player_item.set_attribute_value ("icon", g_icon_serialize (player.icon));
+ if (icon != null)
+ player_item.set_attribute_value ("icon", g_icon_serialize (icon));
section.append_item (player_item);
var playback_item = new MenuItem (null, null);