From d476bec5a2e76d97843bff0fb24d1fef688b7ec0 Mon Sep 17 00:00:00 2001 From: Tobie Morgan Hitchcock Date: Sat, 17 Apr 2021 15:01:16 +0100 Subject: [PATCH] Ensure strings are converted to records if possible --- util/conv/conv.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/util/conv/conv.go b/util/conv/conv.go index b8c6cbb1..d82be5ef 100644 --- a/util/conv/conv.go +++ b/util/conv/conv.go @@ -202,6 +202,10 @@ func ConvertToRecord(obj interface{}, tb string) (val *sql.Thing, err error) { default: err = fmt.Errorf("Expected a record of type '%s', but found '%v'", tb, obj) } + case string: + if val = sql.ParseThing(now); val == nil { + err = fmt.Errorf("Expected a record of type '%s', but found '%v'", tb, obj) + } default: switch tb { default: