Fixed: CxFlow tries to get scan configuration of a non-existent project.
@@ -43,12 +43,8 @@ public class ScanRequestConverter {
}
private void setScanConfiguration(ScanRequest scanRequest, Integer projectId) {
- if (!entityExists(projectId)) {
- // In this case CxClient will use scan configuration name from global CxFlow config.
- log.debug("Project doesn't exist. Scan configuration was not set in scan request.");
- }
-
- log.debug("Using scan configuration of the existing project in scan request.");
+ if (entityExists(projectId)) {
+ log.debug("Scan request will contain scan configuration of the existing project.");
CxScanSettings scanSettings = cxService.getScanSettingsDto(projectId);
if (scanSettings != null && scanSettings.getEngineConfigurationId() != null) {
Integer configId = scanSettings.getEngineConfigurationId();
@@ -58,6 +54,9 @@ public class ScanRequestConverter {
} else {
log.warn("Unable to retrieve scan settings for the existing project (ID {}).", projectId);
}
+ } else {
+ log.debug("Project doesn't exist. Scan configuration from the global config will be used.");
+ }
}
private static boolean entityExists(Integer id) {
