engine: resources: Add missing apply guard

This commit is contained in:
James Shubin
2024-01-16 15:33:05 -05:00
parent 81885dec63
commit 9e70f53afa

View File

@@ -254,7 +254,10 @@ func (obj *KVRes) CheckApply(ctx context.Context, apply bool) (bool, error) {
return true, nil // nothing to delete, we're good!
} else if ok && obj.Value == nil { // delete
err := obj.init.World.StrMapDel(ctx, obj.getKey())
if !apply {
return false, nil
}
err := obj.kvDel(ctx, obj.getKey())
return false, errwrap.Wrapf(err, "apply error during StrDel")
}