@@ -265,27 +265,33 @@ private void loadResults(com.checkmarx.ast.scan.Scan scan) {
265265
266266 @ Override
267267 public void update (@ NotNull AnActionEvent e ) {
268- super .update (e );
268+ try {
269+ super .update (e );
269270
270- e .getPresentation ().setVisible (getUserHasPermissionsToScan ());
271+ e .getPresentation ().setVisible (getUserHasPermissionsToScan ());
271272
272- cxToolWindowPanel = getCxToolWindowPanel (e );
273- workspaceProject = e .getProject ();
274- propertiesComponent = PropertiesComponent .getInstance (Objects .requireNonNull (workspaceProject ));
275- boolean isScanRunning = StringUtils .isNotBlank (propertiesComponent .getValue (Constants .RUNNING_SCAN_ID_PROPERTY ));
276- String storedProject = propertiesComponent .getValue (Constants .SELECTED_PROJECT_PROPERTY );
277- String storedBranch = propertiesComponent .getValue (Constants .SELECTED_BRANCH_PROPERTY );
273+ cxToolWindowPanel = getCxToolWindowPanel (e );
274+ workspaceProject = e .getProject ();
275+ propertiesComponent = PropertiesComponent .getInstance (Objects .requireNonNull (workspaceProject ));
276+ boolean isScanRunning = StringUtils .isNotBlank (propertiesComponent .getValue (Constants .RUNNING_SCAN_ID_PROPERTY ));
277+ String storedProject = propertiesComponent .getValue (Constants .SELECTED_PROJECT_PROPERTY );
278+ String storedBranch = propertiesComponent .getValue (Constants .SELECTED_BRANCH_PROPERTY );
278279
279- boolean projectAndBranchSelected = StringUtils .isNotBlank (storedProject ) && StringUtils .isNotBlank (storedBranch );
280+ boolean projectAndBranchSelected = StringUtils .isNotBlank (storedProject ) && StringUtils .isNotBlank (storedBranch );
280281
281- // Check if IDE was restarted and there's a scan still running
282- if (isScanRunning && !isPollingScan && !actionInitialized ) {
283- pollScan (propertiesComponent .getValue (Constants .RUNNING_SCAN_ID_PROPERTY ));
284- }
282+ // Check if IDE was restarted and there's a scan still running
283+ if (isScanRunning && !isPollingScan && !actionInitialized ) {
284+ pollScan (propertiesComponent .getValue (Constants .RUNNING_SCAN_ID_PROPERTY ));
285+ }
285286
286- actionInitialized = true ;
287+ actionInitialized = true ;
287288
288- e .getPresentation ().setEnabled (!isScanRunning && !isPollingScan && !scanTriggered && projectAndBranchSelected );
289+ e .getPresentation ().setEnabled (!isScanRunning && !isPollingScan && !scanTriggered && projectAndBranchSelected );
290+ }
291+ catch (Exception ex ) {
292+ LOGGER .error (ex );
293+ e .getPresentation ().setEnabled (false );
294+ }
289295 }
290296
291297 /**
0 commit comments