From f0bcda57c0cd9f923a90a41bdd9d25f80101af06 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Tue, 18 Feb 2003 00:22:52 +0000 Subject: in {complete} or {canceled}, ensure giving a bad entry number to focus doesn't break (and log that something wrong happened) --- perl-install/interactive/gtk.pm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'perl-install/interactive') diff --git a/perl-install/interactive/gtk.pm b/perl-install/interactive/gtk.pm index 1514c5a45..98c50250a 100644 --- a/perl-install/interactive/gtk.pm +++ b/perl-install/interactive/gtk.pm @@ -643,7 +643,7 @@ sub ask_fromW { @widgets && ($common->{focus_first} || !$mainw->{ok} || @widgets == 1 && member(ref($widgets[0]{focus_w}), "Gtk2::TreeView", "Gtk2::RadioButton")) ? $widgets[0]{focus_w} : $mainw->{ok}; - $widget_to_focus->grab_focus() if $widget_to_focus; + $widget_to_focus->grab_focus if $widget_to_focus; my $check = sub { my ($f) = @_; @@ -653,7 +653,11 @@ sub ask_fromW { if ($error) { $set_all->(); - $widgets[$focus || 0]{focus_w}->grab_focus(); + if (my $to_focus = $widgets[$focus || 0]) { + $to_focus->{focus_w}->grab_focus; + } else { + log::l("ERROR: bad entry number given to focus " . backtrace()); + } } !$error; } -- cgit v1.2.1