diff options
author | tadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-08-12 23:50:07 +0000 |
---|---|---|
committer | tadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-08-12 23:50:07 +0000 |
commit | 7eab4f34ff30aa708aee58b1abab8e4a2772f46b (patch) | |
tree | 8f2029323aaa7df8a715b701a0d48c1b0d684940 /ext | |
parent | 0fafdc0f34feaf26448c76b74102c23cd03e4a9a (diff) |
* ext/date/date_core.c: [ruby-core:38855].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@32956 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r-- | ext/date/date_core.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ext/date/date_core.c b/ext/date/date_core.c index 08328b9e8f..6474074028 100644 --- a/ext/date/date_core.c +++ b/ext/date/date_core.c @@ -4089,6 +4089,9 @@ d_new_by_frags(VALUE klass, VALUE hash, VALUE sg) rb_warning("invalid start is ignored"); } + if (NIL_P(hash)) + rb_raise(rb_eArgError, "invalid date"); + if (NIL_P(ref_hash("jd")) && NIL_P(ref_hash("yday")) && !NIL_P(ref_hash("year")) && @@ -7853,6 +7856,9 @@ dt_new_by_frags(VALUE klass, VALUE hash, VALUE sg) rb_warning("invalid start is ignored"); } + if (NIL_P(hash)) + rb_raise(rb_eArgError, "invalid date"); + if (NIL_P(ref_hash("jd")) && NIL_P(ref_hash("yday")) && !NIL_P(ref_hash("year")) && |