Skip to content

Commit

Permalink
fix: incorrectly exiting with undefined when dependant function expec…
Browse files Browse the repository at this point in the history
…ts URI

Signed-off-by: Jonathan Stevens <[email protected]>
  • Loading branch information
TGTGamer committed Mar 2, 2024
1 parent 36b03c7 commit 83b6f37
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/schema/src/utils/ast-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,7 @@ export function resolveImportUri(imp: ModelImport): URI | undefined {
&& !imp.path.startsWith('/') // Respect absolute paths (Unix)
&& !/^[a-zA-Z]:\\/.test(imp.path) // Respect absolute paths (Windows)
) {
imp.path = findNodeModulesFile(imp.path) ?? '';
if (!imp.path) return undefined; // If the path is empty, return undefined
imp.path = findNodeModulesFile(imp.path) ?? imp.path;
}

const dirUri = Utils.dirname(getDocument(imp).uri);
Expand Down

0 comments on commit 83b6f37

Please sign in to comment.