Skip to content

Commit 07ea3fc

Browse files
authored
fix: handle the issueCache" is null NullPointerException (#333)
fix: handle NullPointerException in removeAllIssuesForPath
1 parent b93d910 commit 07ea3fc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

plugin/src/main/java/io/snyk/languageserver/protocolextension/SnykExtendedLanguageClient.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -745,6 +745,10 @@ private void populateFileAndIssueNodes(ProductTreeNode productTreeNode, SnykIssu
745745

746746
private void populateIssueCache(PublishDiagnostics316Param param, String filePath) {
747747
var issueCache = getIssueCache(filePath);
748+
if (issueCache == null) {
749+
SnykLogger.logInfo("Issue cache is null for file path: " + filePath + ", skipping cache population");
750+
return;
751+
}
748752
Diagnostic316[] diagnostics = param.getDiagnostics();
749753
if (diagnostics == null || diagnostics.length == 0) {
750754
issueCache.removeAllIssuesForPath(filePath);

0 commit comments

Comments
 (0)