summaryrefslogtreecommitdiff
path: root/time.c
diff options
context:
space:
mode:
Diffstat (limited to 'time.c')
-rw-r--r--time.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/time.c b/time.c
index f801ee5ac1..dc4a8dbd4d 100644
--- a/time.c
+++ b/time.c
@@ -3623,6 +3623,7 @@ time_localtime(VALUE time)
{
struct time_object *tobj;
struct vtm vtm;
+ VALUE zone;
GetTimeval(time, tobj);
if (TZMODE_LOCALTIME_P(tobj)) {
@@ -3633,7 +3634,8 @@ time_localtime(VALUE time)
time_modify(time);
}
- if (!NIL_P(tobj->vtm.zone) && zone_localtime(tobj->vtm.zone, time)) {
+ zone = tobj->vtm.zone;
+ if (maybe_tzobj_p(zone) && zone_localtime(zone, time)) {
return time;
}