aboutsummaryrefslogtreecommitdiffstats
path: root/Rpmdrake
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2008-02-13 14:37:56 +0000
committerThierry Vignaud <tv@mandriva.org>2008-02-13 14:37:56 +0000
commitaa48292e34c25eca154646160a329d71910d84d4 (patch)
treeeae8b268f804256bcc68c99267588294aef3b5c5 /Rpmdrake
parent8bcf70f6d86e80b5e98dca869e310c9adb502485 (diff)
downloadrpmdrake-aa48292e34c25eca154646160a329d71910d84d4.tar
rpmdrake-aa48292e34c25eca154646160a329d71910d84d4.tar.gz
rpmdrake-aa48292e34c25eca154646160a329d71910d84d4.tar.bz2
rpmdrake-aa48292e34c25eca154646160a329d71910d84d4.tar.xz
rpmdrake-aa48292e34c25eca154646160a329d71910d84d4.zip
(get_icon) do not crash when a icon is missing (#37700)
Diffstat (limited to 'Rpmdrake')
-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');
}