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 <jonathan.stevens@resnovas.com>
  • Loading branch information
TGTGamer committed Mar 2, 2024
1 parent 3e5b0d9 commit 5a5dcd4
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 5a5dcd4

Please sign in to comment.