aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2008-02-13 14:39:02 +0000
committerThierry Vignaud <tv@mandriva.org>2008-02-13 14:39:02 +0000
commit699bfa00f0b6864af132b4e7ab275b69cca17080 (patch)
tree215a914d3def345deb7da8403a7fdd2d4a325f62
parent9ba9997d30cf7505d2f28455abd3e345dfb33f01 (diff)
downloadrpmdrake-699bfa00f0b6864af132b4e7ab275b69cca17080.tar
rpmdrake-699bfa00f0b6864af132b4e7ab275b69cca17080.tar.gz
rpmdrake-699bfa00f0b6864af132b4e7ab275b69cca17080.tar.bz2
rpmdrake-699bfa00f0b6864af132b4e7ab275b69cca17080.tar.xz
rpmdrake-699bfa00f0b6864af132b4e7ab275b69cca17080.zip
(get_icon) do not crash when a icon is missing (#37700)
-rw-r--r--Rpmdrake/icon.pm6
1 files changed, 3 insertions, 3 deletions
diff --git a/Rpmdrake/icon.pm b/Rpmdrake/icon.pm
index e069be5f..52ebe3ee 100644
--- a/Rpmdrake/icon.pm
+++ b/Rpmdrake/icon.pm
@@ -187,9 +187,9 @@ sub get_icon {
my ($group, $parent) = @_;
my $pixbuf;
my $path = $group =~ /\|/ ? '/usr/share/icons/mini/' : '/usr/share/icons/';
- my $create_pixbuf = sub { gtknew('Pixbuf', file => join('', $path, $_[0], '.png')) };
- eval { $pixbuf = $create_pixbuf->($group_icons{$group}) };
- eval { $pixbuf ||= $create_pixbuf->($group_icons{$parent}) } if $parent;
+ my $create_pixbuf = sub { eval { gtknew('Pixbuf', file => join('', $path, $_[0], '.png')) } };
+ $pixbuf = $create_pixbuf->($group_icons{$group});
+ $pixbuf ||= $create_pixbuf->($group_icons{$parent}) if $parent;
$pixbuf ||= $create_pixbuf->('applications_section');
}