aboutsummaryrefslogtreecommitdiffstats
path: root/numeric.c
diff options
context:
space:
mode:
Diffstat (limited to 'numeric.c')
-rw-r--r--numeric.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/numeric.c b/numeric.c
index 17d15f6c92..dabcdc39de 100644
--- a/numeric.c
+++ b/numeric.c
@@ -209,6 +209,9 @@ rb_num_get_rounding_option(VALUE opts)
if (SYMBOL_P(rounding)) {
str = rb_sym2str(rounding);
}
+ else if (NIL_P(rounding)) {
+ goto noopt;
+ }
else if (!RB_TYPE_P(str = rounding, T_STRING)) {
str = rb_check_string_type(rounding);
if (NIL_P(str)) goto invalid;