File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
src/main/java/com/sap/prd/jenkins/plugins/agent_maintenance Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -55,18 +55,22 @@ public String getDescription() {
5555
5656 @ Override
5757 public String getDisplayName () {
58- List <MaintenanceAction > all = getTargets ();
58+ List <MaintenanceAction > all = null ;
59+ try {
60+ all = getTargets ();
61+ } catch (IOException e ) {
62+ LOGGER .log (Level .WARNING , "Error while reading maintenance windows" , e );
63+ return Messages .MaintenanceLink_displayName ();
64+ }
5965 boolean hasAgents = all .stream ().anyMatch (MaintenanceAction ::isAgent );
6066 boolean hasClouds = all .stream ().anyMatch (MaintenanceAction ::isCloud );
6167
6268 if (hasAgents && !hasClouds ) {
6369 return Messages .MaintenanceLink_displayName_agent ();
6470 }
65-
6671 if (hasClouds && !hasAgents ) {
6772 return Messages .MaintenanceLink_displayName_cloud ();
6873 }
69-
7074 return Messages .MaintenanceLink_displayName ();
7175 }
7276
You can’t perform that action at this time.
0 commit comments