summaryrefslogtreecommitdiff
path: root/ext/date/date_core.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/date/date_core.c')
-rw-r--r--ext/date/date_core.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/ext/date/date_core.c b/ext/date/date_core.c
index e372a12cd7..d1d03fe407 100644
--- a/ext/date/date_core.c
+++ b/ext/date/date_core.c
@@ -4342,6 +4342,8 @@ get_limit(VALUE opt)
static void
check_limit(VALUE str, VALUE opt)
{
+ if (NIL_P(str)) return;
+
StringValue(str);
size_t slen = RSTRING_LEN(str);
size_t limit = get_limit(opt);