diff options
author | Conor Curran <conor.curran@canonical.com> | 2011-06-14 18:24:46 +0200 |
---|---|---|
committer | Conor Curran <conor.curran@canonical.com> | 2011-06-14 18:24:46 +0200 |
commit | 2e0dd336905735dc75d3ab7e676ef60af76ae746 (patch) | |
tree | 5167d693d6b9f1ba4a21a1fe026526e64edc7d02 /src/metadata-menu-item.vala | |
parent | 4b0e1e3ae018d0f57104f8b309f159f70fd976dc (diff) | |
download | ayatana-indicator-sound-2e0dd336905735dc75d3ab7e676ef60af76ae746.tar.gz ayatana-indicator-sound-2e0dd336905735dc75d3ab7e676ef60af76ae746.tar.bz2 ayatana-indicator-sound-2e0dd336905735dc75d3ab7e676ef60af76ae746.zip |
caught most of the little bugs I could find@
Diffstat (limited to 'src/metadata-menu-item.vala')
-rw-r--r-- | src/metadata-menu-item.vala | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/metadata-menu-item.vala b/src/metadata-menu-item.vala index dccf478..995d248 100644 --- a/src/metadata-menu-item.vala +++ b/src/metadata-menu-item.vala @@ -104,10 +104,16 @@ public class MetadataMenuitem : PlayerItem public void fetch_art(string uri, string prop) { File art_file = File.new_for_uri(uri); - if(art_file.is_native() == true){ + if (art_file.is_native() == true){ + if (art_file.query_exists() == false){ + // Can't load the image, set prop to empty and return. + this.property_set_int ( prop, EMPTY ); + return; + } string path; try{ - path = Filename.from_uri ( uri.strip() ); + path = Filename.from_uri ( uri.strip() ); + debug ("Populating the artwork field with %s", uri.strip()); this.property_set ( prop, path ); } catch(ConvertError e){ @@ -150,7 +156,7 @@ public class MetadataMenuitem : PlayerItem if(this.previous_temp_album_art_path != null){ FileUtils.remove(this.previous_temp_album_art_path); } - this.previous_temp_album_art_path = path; + this.previous_temp_album_art_path = path; } } catch(GLib.Error e){ |