Handle the case where there is no ivar set.

This happens on jruby due to a bug, but also on historically marshalled data.
This commit is contained in:
Michael Koziarski
2008-09-04 15:08:46 +02:00
parent 7ba2872615
commit 2c62baf4bf

View File

@@ -15,7 +15,7 @@ class Time
alias_method :_original_load, :_load
def _load(marshaled_time)
time = _original_load(marshaled_time)
utc = time.send(:remove_instance_variable, '@marshal_with_utc_coercion')
utc = time.instance_variable_get('@marshal_with_utc_coercion')
utc ? time.utc : time
end
end