Skip to content

Commit 134edd9

Browse files
committed
internal/mcp/jsonschema: fix panic during schema validation
s.base is not yet set, so the fmt.Errorf call panics when accessing s.base.uri. Change-Id: I9e508406772d66bbf513bdbe2330c171df28ea85 Reviewed-on: https://go-review.googlesource.com/c/tools/+/684915 LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Jonathan Amsterdam <[email protected]> Auto-Submit: Robert Findley <[email protected]>
1 parent d58c5eb commit 134edd9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/mcp/jsonschema/resolve.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ func resolveURIs(root *Schema, baseURI *url.URL) (map[string]*Schema, error) {
334334
// The base URI for this schema is its $id resolved against the parent base.
335335
s.uri = base.uri.ResolveReference(idURI)
336336
if !s.uri.IsAbs() {
337-
return fmt.Errorf("$id %s does not resolve to an absolute URI (base is %s)", s.ID, s.base.uri)
337+
return fmt.Errorf("$id %s does not resolve to an absolute URI (base is %s)", s.ID, base.uri)
338338
}
339339
resolvedURIs[s.uri.String()] = s
340340
base = s // needed for anchors

0 commit comments

Comments
 (0)