From b8c3b570a4de30754fcab86a07d9ec3592abc416 Mon Sep 17 00:00:00 2001 From: kolaente Date: Fri, 2 Dec 2022 14:49:29 +0100 Subject: [PATCH] fix(restore): check if we're really dealing with a string --- pkg/db/dump.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/db/dump.go b/pkg/db/dump.go index b5e22ebaae..3491ae1e20 100644 --- a/pkg/db/dump.go +++ b/pkg/db/dump.go @@ -77,7 +77,8 @@ func Restore(table string, contents []map[string]interface{}) (err error) { // users being scheduled for deletion after a restore. // To avoid this, we set these dates to nil so that they'll end up as null in the db. col := metaForCurrentTable.GetColumn(colName) - if col.SQLType.IsTime() && (value.(string) == "" || strings.HasPrefix(value.(string), "0001-")) { + strVal, is := value.(string) + if is && col.SQLType.IsTime() && (strVal == "" || strings.HasPrefix(strVal, "0001-")) { content[colName] = nil } }