[perl-Gtk3] GtkRadio*: correctly handle groups containing a single undef



commit d35c1c1022fed43dfb483b906ce95fa605a6a8bc
Author: Torsten Schönfeld <kaffeetisch gmx de>
Date:   Fri Dec 6 23:33:44 2013 +0100

    GtkRadio*: correctly handle groups containing a single undef
    
    Reported by Thierry Vignaud.

 lib/Gtk3.pm |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/lib/Gtk3.pm b/lib/Gtk3.pm
index 4d0bb09..2ff6f69 100644
--- a/lib/Gtk3.pm
+++ b/lib/Gtk3.pm
@@ -987,8 +987,12 @@ sub Gtk3::MessageDialog::new {
       return ($ctor, []);
     }
     # [member1, ...] => member1
-    elsif (eval { $#$group_or_member >= 0}) {
-      return ($ctor . '_from_widget', $group_or_member->[0]);
+    elsif (eval { $#$group_or_member >= 0 }) {
+      my $member = $group_or_member->[0];
+      if (defined $member) {
+        return ($ctor . '_from_widget', $member);
+      }
+      return ($ctor, []);
     }
     # member => member
     elsif (eval { $group_or_member->isa ('Gtk3::' . $package) }) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]