diff --git a/test.go b/test.go index 3aca9d88..f9b6bf9b 100644 --- a/test.go +++ b/test.go @@ -8,7 +8,9 @@ func SetTestNow(carbon Carbon) Carbon { // SetTestNow sets a test Carbon instance (real or mock) to be returned when a "now" instance is created. func (c Carbon) SetTestNow(carbon Carbon) Carbon { c.testNow = carbon.TimestampNano() - c.loc = carbon.loc + if carbon.loc != nil { + c.loc = carbon.loc + } return c }