Parcourir la source

Merge pull request #810 from clawconduce/master

When unmarshalling timestamps set null values to 0 time to be consist…
Chris Bannister il y a 9 ans
Parent
commit
ee3015e54e
2 fichiers modifiés avec 2 ajouts et 0 suppressions
  1. 1 0
      AUTHORS
  2. 1 0
      marshal.go

+ 1 - 0
AUTHORS

@@ -80,3 +80,4 @@ Marcus King <marcusking01@gmail.com>
 Andrew de Andrade <andrew@deandrade.com.br>
 Andrew de Andrade <andrew@deandrade.com.br>
 Robert Nix <robert@nicerobot.org>
 Robert Nix <robert@nicerobot.org>
 Nathan Youngman <git@nathany.com>
 Nathan Youngman <git@nathany.com>
+Charles Law <charles.law@gmail.com>; <claw@conduce.com>

+ 1 - 0
marshal.go

@@ -1094,6 +1094,7 @@ func unmarshalTimestamp(info TypeInfo, data []byte, value interface{}) error {
 		return nil
 		return nil
 	case *time.Time:
 	case *time.Time:
 		if len(data) == 0 {
 		if len(data) == 0 {
+			*v = time.Time{}
 			return nil
 			return nil
 		}
 		}
 		x := decBigInt(data)
 		x := decBigInt(data)