diff options
Diffstat (limited to 'transcode.c')
| -rw-r--r-- | transcode.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/transcode.c b/transcode.c index 1ba30c825..c087716b4 100644 --- a/transcode.c +++ b/transcode.c @@ -1687,7 +1687,10 @@ str_transcode(int argc, VALUE *argv, VALUE *self) VALUE opt; int options = 0; - opt = rb_check_convert_type(argv[argc-1], T_HASH, "Hash", "to_hash"); + if (0 < argc) + opt = rb_check_convert_type(argv[argc-1], T_HASH, "Hash", "to_hash"); + else + opt = Qnil; if (!NIL_P(opt)) { VALUE v; |
