aboutsummaryrefslogtreecommitdiffstats
path: root/re.c
diff options
context:
space:
mode:
Diffstat (limited to 're.c')
-rw-r--r--re.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/re.c b/re.c
index 67ee4dfc1b..b7603e0f29 100644
--- a/re.c
+++ b/re.c
@@ -1392,7 +1392,9 @@ static void
match_setter(val)
VALUE val;
{
- Check_Type(val, T_MATCH);
+ if (!NIL_P(val)) {
+ Check_Type(val, T_MATCH);
+ }
rb_backref_set(val);
}