From 666bd514e2b2f43a39d1ebc56825d8748a3fdc31 Mon Sep 17 00:00:00 2001 From: Jack Christensen Date: Wed, 19 Feb 2020 10:50:58 -0600 Subject: [PATCH] Add standard nil test to gofrs-uuid.UUID.Set --- ext/gofrs-uuid/uuid.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ext/gofrs-uuid/uuid.go b/ext/gofrs-uuid/uuid.go index c1179ae2..a358fead 100644 --- a/ext/gofrs-uuid/uuid.go +++ b/ext/gofrs-uuid/uuid.go @@ -17,6 +17,11 @@ type UUID struct { } func (dst *UUID) Set(src interface{}) error { + if src == nil { + *dst = UUID{Status: pgtype.Null} + return nil + } + switch value := src.(type) { case uuid.UUID: *dst = UUID{UUID: value, Status: pgtype.Present}