This is an automated email from the ASF dual-hosted git repository.

mbien pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
     new e79862958d [NETBEANS-6682] Adds null check before calling nullable 
repository variable to avoid NPE
     new 91b284602b Merge pull request #6694 from 
snreinert/fix/null-pointer-exception-class-path-provider-6682
e79862958d is described below

commit e79862958d6058f63b8a06cf2b26b7a504899889
Author: Steve Reinert <[email protected]>
AuthorDate: Mon Nov 13 12:21:38 2023 -0700

    [NETBEANS-6682] Adds null check before calling nullable repository variable 
to avoid NPE
---
 .../netbeans/modules/java/openjdk/project/ClassPathProviderImpl.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/java/java.openjdk.project/src/org/netbeans/modules/java/openjdk/project/ClassPathProviderImpl.java
 
b/java/java.openjdk.project/src/org/netbeans/modules/java/openjdk/project/ClassPathProviderImpl.java
index dbecca5936..bd152ca7fb 100644
--- 
a/java/java.openjdk.project/src/org/netbeans/modules/java/openjdk/project/ClassPathProviderImpl.java
+++ 
b/java/java.openjdk.project/src/org/netbeans/modules/java/openjdk/project/ClassPathProviderImpl.java
@@ -203,7 +203,7 @@ public class ClassPathProviderImpl implements 
ClassPathProvider {
     @Override
     public ClassPath findClassPath(FileObject file, String type) {
         if (sourceCP.findOwnerRoot(file) != null) {
-            if (!repository.isAnyProjectOpened()) {
+            if (repository != null && !repository.isAnyProjectOpened()) {
                 //if no project is open, java.base may not be indexed. 
Fallback on default queries:
                 return null;
             }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to