From 5a64534fca235bd30af643c0de56c281192c7b07 Mon Sep 17 00:00:00 2001 From: Rodin Aarssen Date: Wed, 18 Dec 2024 10:12:22 +0100 Subject: [PATCH] Improved handling of an edge case around the fallback resolver. --- src/org/rascalmpl/uri/URIResolverRegistry.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/org/rascalmpl/uri/URIResolverRegistry.java b/src/org/rascalmpl/uri/URIResolverRegistry.java index ebb5852a1f..9051eb8c76 100644 --- a/src/org/rascalmpl/uri/URIResolverRegistry.java +++ b/src/org/rascalmpl/uri/URIResolverRegistry.java @@ -402,11 +402,9 @@ private ISourceLocation physicalLocation(ISourceLocation loc) throws IOException ILogicalSourceLocationResolver resolver = map.get(auth); loc = resolveAndFixOffsets(loc, resolver, map.values()); } - if (loc == null) { - loc = original; - } + if (fallbackLogicalResolver != null) { - var fallbackResult = resolveAndFixOffsets(loc, fallbackLogicalResolver, Collections.emptyList()); + var fallbackResult = resolveAndFixOffsets(loc == null ? original : loc, fallbackLogicalResolver, Collections.emptyList()); return fallbackResult == null ? loc : fallbackResult; } return loc;