summaryrefslogtreecommitdiff
path: root/ext/tk/tkutil.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/tk/tkutil.c')
-rw-r--r--ext/tk/tkutil.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/tk/tkutil.c b/ext/tk/tkutil.c
index 39047804b3..4654619169 100644
--- a/ext/tk/tkutil.c
+++ b/ext/tk/tkutil.c
@@ -214,6 +214,10 @@ tk_symbolkey2str(self, keys)
{
volatile VALUE new_keys = rb_hash_new();
+ if NIL_P(keys) return new_keys;
+ if (TYPE(keys) != T_HASH) {
+ rb_raise(rb_eArgError, "Hash is expected");
+ }
st_foreach(RHASH(keys)->tbl, to_strkey, new_keys);
return new_keys;
}