From 1c9f9e79e7ec25bacb7de5fd110aa9425d6c63ad Mon Sep 17 00:00:00 2001 From: AllenX2018 Date: Thu, 7 Jan 2021 11:40:32 +0800 Subject: [PATCH] Fix orm many2many generated table error --- client/orm/models_utils.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client/orm/models_utils.go b/client/orm/models_utils.go index 950ca243..b2e5760e 100644 --- a/client/orm/models_utils.go +++ b/client/orm/models_utils.go @@ -109,6 +109,9 @@ func getTableUnique(val reflect.Value) [][]string { // get whether the table needs to be created for the database alias func isApplicableTableForDB(val reflect.Value, db string) bool { + if !val.IsValid() { + return true + } fun := val.MethodByName("IsApplicableTableForDB") if fun.IsValid() { vals := fun.Call([]reflect.Value{reflect.ValueOf(db)})