ext/oj/mimic_json.c in oj-3.13.13 vs ext/oj/mimic_json.c in oj-3.13.14
- old
+ new
@@ -458,10 +458,10 @@
// instance and not a Hash gives the desired behavior.
*rargs = *argv;
if (0 == argc) {
rb_raise(rb_eArgError, "wrong number of arguments (0))");
}
- if (1 == argc) {
+ if (1 == argc || Qnil == argv[1]) {
h = rb_hash_new();
} else {
h = argv[1];
}
if (!oj_hash_has_key(h, oj_indent_sym)) {