From c7cd1df74f5846dabba1123346fd2ae30ea22be1 Mon Sep 17 00:00:00 2001 From: Tomasz Pasternak Date: Tue, 5 Nov 2024 12:37:01 +0100 Subject: [PATCH] fix: NPE in location provider (#6960) closes #6959 --- .../google/idea/blaze/base/ui/BlazeModuleRendererFactory.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/base/src/com/google/idea/blaze/base/ui/BlazeModuleRendererFactory.java b/base/src/com/google/idea/blaze/base/ui/BlazeModuleRendererFactory.java index 7b87a68e482..e886d90bce8 100644 --- a/base/src/com/google/idea/blaze/base/ui/BlazeModuleRendererFactory.java +++ b/base/src/com/google/idea/blaze/base/ui/BlazeModuleRendererFactory.java @@ -42,6 +42,9 @@ protected boolean handles(Object element) { return null; } var sourceRoot = index.getSourceRootForFile(file); + if (sourceRoot == null) { + return null; + } var relativeSourceRoot = WorkspaceRoot.fromProject(project).relativize(sourceRoot); if (relativeSourceRoot == null) { return null;