Skip to content

Commit aecb44e

Browse files
AST-101305: Disable Branch and Scan controls when no project is selected
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
1 parent 1b94a50 commit aecb44e

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

checkmarx-ast-eclipse-plugin/src/com/checkmarx/eclipse/views/CheckmarxView.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ protected IStatus run(IProgressMonitor arg0) {
421421
});
422422

423423
if (!currentBranch.isEmpty()) {
424-
updateStartScanButton(true);
424+
updateStartScanButton(!currentProjectId.isEmpty());
425425
sync.asyncExec(() -> {
426426
PluginUtils.setTextForComboViewer(branchComboViewer, currentBranch);
427427
});
@@ -446,7 +446,7 @@ protected IStatus run(IProgressMonitor arg0) {
446446
sync.asyncExec(() -> {
447447
PluginUtils.enableComboViewer(projectComboViewer, true);
448448
PluginUtils.enableComboViewer(scanIdComboViewer, true);
449-
PluginUtils.enableComboViewer(branchComboViewer, true);
449+
PluginUtils.enableComboViewer(branchComboViewer, !currentProjectId.isEmpty());
450450
});
451451
}
452452
} else {

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,9 @@ public void run() {
111111
startScanAction.setImageDescriptor(Activator.getImageDescriptor(ACTION_START_SCAN_ICON_PATH));
112112

113113
String branch = GlobalSettings.getFromPreferences(GlobalSettings.PARAM_BRANCH, PluginConstants.EMPTY_STRING);
114+
String project = GlobalSettings.getFromPreferences(GlobalSettings.PARAM_PROJECT_ID, PluginConstants.EMPTY_STRING);
114115

115-
startScanAction.setEnabled(StringUtils.isNotBlank(branch));
116+
startScanAction.setEnabled(StringUtils.isNotBlank(branch) && StringUtils.isNotBlank(project));
116117

117118
String runningScanId = GlobalSettings.getFromPreferences(GlobalSettings.PARAM_RUNNING_SCAN_ID,
118119
PluginConstants.EMPTY_STRING);

0 commit comments

Comments
 (0)