diff options
author | Olivier Blin <oblin@mandriva.org> | 2005-08-24 15:16:01 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.org> | 2005-08-24 15:16:01 +0000 |
commit | d54c1557c01a38d6f45e9c9c20bae831c487f173 (patch) | |
tree | 4746aafc3c26936e5ea04cfb69fa03b97d5f4e1a /perl-install/interactive | |
parent | e582f460c246b221db8a3c8a480007c8a6d9c98b (diff) | |
download | drakx-d54c1557c01a38d6f45e9c9c20bae831c487f173.tar drakx-d54c1557c01a38d6f45e9c9c20bae831c487f173.tar.gz drakx-d54c1557c01a38d6f45e9c9c20bae831c487f173.tar.bz2 drakx-d54c1557c01a38d6f45e9c9c20bae831c487f173.tar.xz drakx-d54c1557c01a38d6f45e9c9c20bae831c487f173.zip |
do not crash in create_treeview_tree with allow_empty_list and really empty list (#17718)
Diffstat (limited to 'perl-install/interactive')
-rw-r--r-- | perl-install/interactive/gtk.pm | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/perl-install/interactive/gtk.pm b/perl-install/interactive/gtk.pm index 045b7e4f1..1242b6387 100644 --- a/perl-install/interactive/gtk.pm +++ b/perl-install/interactive/gtk.pm @@ -306,16 +306,18 @@ sub create_treeview_tree { }); $tree, sub { - my $v = may_apply($e->{format}, $_[0]); - my $i = find_index { $v eq $_ } @{$e->{formatted_list}}; + my $v = may_apply($e->{format}, $_[0]); + eval { + my $i = find_index { $v eq $_ } @{$e->{formatted_list}}; - my ($model, $iter) = $tree->get_selection->get_selected; + my ($model, $iter) = $tree->get_selection->get_selected; - my $new_path_str = $tree_model->{path_str_list}[$i]; - my $old_path_str = $model && $tree_model->get_path_str($iter); - - $select->($new_path_str) if $new_path_str ne $old_path_str; - undef $iter if ref $iter; + my $new_path_str = $tree_model->{path_str_list}[$i]; + my $old_path_str = $model && $tree_model->get_path_str($iter); + + $select->($new_path_str) if $new_path_str ne $old_path_str; + undef $iter if ref $iter; + }; }; } |