diff options
Diffstat (limited to 'ext/json/ext/parser/parser.rl')
-rw-r--r-- | ext/json/ext/parser/parser.rl | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/ext/json/ext/parser/parser.rl b/ext/json/ext/parser/parser.rl index e7d47e1..8c4681d 100644 --- a/ext/json/ext/parser/parser.rl +++ b/ext/json/ext/parser/parser.rl @@ -688,6 +688,7 @@ static VALUE cParser_initialize(int argc, VALUE *argv, VALUE self) json->object_class = Qnil; json->array_class = Qnil; } + source = rb_convert_type(source, T_STRING, "String", "to_str"); if (!json->quirks_mode) { source = convert_encoding(StringValue(source)); } |