Skip to content

Commit

Permalink
Fixed logic around fallback resolver in URIResolverRegistry (#2101)
Browse files Browse the repository at this point in the history
* Fixed logic around the fallback resolver returning null while resolving locations

* Accounted for another edge case around the fallback resolver. Thanks @DavyLandman

* Improved handling of an edge case around the fallback resolver.

* Improved handling of an edge case around the fallback resolver.
  • Loading branch information
rodinaarssen authored Dec 18, 2024
1 parent 4871681 commit cfc601c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/org/rascalmpl/uri/URIResolverRegistry.java
Original file line number Diff line number Diff line change
Expand Up @@ -402,9 +402,10 @@ private ISourceLocation physicalLocation(ISourceLocation loc) throws IOException
ILogicalSourceLocationResolver resolver = map.get(auth);
loc = resolveAndFixOffsets(loc, resolver, map.values());
}
var fallBack = fallbackLogicalResolver;
if (fallBack != null) {
return resolveAndFixOffsets(loc == null ? original : loc, fallBack, Collections.emptyList());

if (fallbackLogicalResolver != null) {
var fallbackResult = resolveAndFixOffsets(loc == null ? original : loc, fallbackLogicalResolver, Collections.emptyList());
return fallbackResult == null ? loc : fallbackResult;
}
return loc;
}
Expand Down

0 comments on commit cfc601c

Please sign in to comment.