aboutsummaryrefslogtreecommitdiffstats
path: root/class.c
diff options
context:
space:
mode:
Diffstat (limited to 'class.c')
-rw-r--r--class.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/class.c b/class.c
index 25f73ecd51..2d5657d865 100644
--- a/class.c
+++ b/class.c
@@ -1912,6 +1912,8 @@ rb_get_kwargs(VALUE keyword_hash, const ID *table, int required, int optional, V
st_delete(rb_hash_tbl_raw(keyword_hash), &key, (val)) : \
st_lookup(rb_hash_tbl_raw(keyword_hash), key, (val)))
+ if (NIL_P(keyword_hash)) keyword_hash = 0;
+
if (optional < 0) {
rest = 1;
optional = -1-optional;