Skip to content

Commit 5bfa931

Browse files
Fix AST-137779: Guard against null getResults() in cxProjectMatchesWorkspaceProject
Results.getResults() can return null when no results have been loaded yet (e.g. fresh IDE session before any scan is imported). The prior check only guarded against a null Results object, causing an NPE on the first click of the Start Scan button and preventing scans from running. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
1 parent 6330783 commit 5bfa931

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

checkmarx-ast-eclipse-plugin/src/com/checkmarx/eclipse/views/actions/ActionStartScan.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ private String getCurrentGitBranch() {
220220
*/
221221
private boolean cxProjectMatchesWorkspaceProject() {
222222
Results results = DataProvider.getInstance().getCurrentResults();
223-
boolean noResultsInScan = results == null || results.getResults().isEmpty();
223+
boolean noResultsInScan = results == null || results.getResults() == null || results.getResults().isEmpty();
224224
boolean noFilesInWorkspace = ResourcesPlugin.getWorkspace().getRoot().getProjects().length == 0;
225225

226226
if (noResultsInScan || noFilesInWorkspace) {

0 commit comments

Comments
 (0)