diff options
-rw-r--r-- | ext/tk/lib/tk/menu.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/tk/lib/tk/menu.rb b/ext/tk/lib/tk/menu.rb index 3ae0548dd1..0e4f419e15 100644 --- a/ext/tk/lib/tk/menu.rb +++ b/ext/tk/lib/tk/menu.rb @@ -569,7 +569,7 @@ class Tk::OptionMenubutton<Tk::Menubutton keys = _symbolkey2str(keys) parent = nil - if args[0].kind_of?(TkWindow) || args[0] == nil + if !args.empty? && (args[0].kind_of?(TkWindow) || args[0] == nil) keys.delete('parent') # ignore parent = args.shift else @@ -577,7 +577,7 @@ class Tk::OptionMenubutton<Tk::Menubutton end @variable = nil - if args[0].kind_of?(TkVariable) || args[0] == nil + if !args.empty? && (args[0].kind_of?(TkVariable) || args[0] == nil) keys.delete('variable') # ignore @variable = args.shift else |