From 481903e72a860ba7c2ac8604e38fda4af8932794 Mon Sep 17 00:00:00 2001 From: nullptrdevs <16590917+nullptrdevs@users.noreply.github.com> Date: Thu, 25 Aug 2022 15:52:07 -0700 Subject: [PATCH] fix: fix an attempt to use null value in DocumentStore.resolveImport caused by missing files or weird file path starting e.g. ``` pub const abc = @import(".////abc.zig"); ``` --- src/DocumentStore.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DocumentStore.zig b/src/DocumentStore.zig index ddd87b1..47235d0 100644 --- a/src/DocumentStore.zig +++ b/src/DocumentStore.zig @@ -953,7 +953,7 @@ pub fn resolveImport(self: *DocumentStore, handle: *Handle, import_str: []const for (handle.imports_used.items) |uri| { if (std.mem.eql(u8, uri, final_uri)) { - return self.getHandle(final_uri).?; + return self.getHandle(final_uri) orelse return null; } } // The URI must be somewhere in the import_uris or the package uris