lang: ast, core: Add some safety checks

I don't think I'm hitting these, but good for debugging.
This commit is contained in:
James Shubin
2025-05-09 01:08:12 -04:00
parent e86d66b906
commit e9d485b7f6
2 changed files with 25 additions and 0 deletions

View File

@@ -482,6 +482,9 @@ func (obj *CollectFunc) Call(ctx context.Context, args []types.Value) (types.Val
if x.Host == "" {
return nil, fmt.Errorf("unexpected empty host")
}
if x.Host == "*" { // safety check
return nil, fmt.Errorf("unexpected star host")
}
if x.Data == "" {
return nil, fmt.Errorf("unexpected empty data")
}