Properly check for discriminator field in context

This commit is contained in:
George Suntres
2026-04-23 13:21:13 -04:00
parent ac33f2f04c
commit 47be80bafb
4 changed files with 16 additions and 5 deletions

View File

@@ -49,7 +49,11 @@ func BuildInsertOne(col map[string]any, report *InitReport) {
if isSystem {
db = sysDb
} else {
account := ctx.Value("account").(string)
accountAny := ctx.Value("account")
if accountAny == nil {
return nil, fmt.Errorf("account required for %s", name)
}
account := accountAny.(string)
if account != "" {
db = mc.GetName(account)
}