File tree Expand file tree Collapse file tree
plugin/src/main/java/io/jenkins/plugins/casc Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5858import java .util .List ;
5959import java .util .Map ;
6060import java .util .Objects ;
61+ import java .util .Optional ;
6162import java .util .Scanner ;
6263import java .util .Set ;
6364import java .util .TreeSet ;
@@ -262,7 +263,13 @@ public FormValidation doCheckNewSource(@QueryParameter String newSource) {
262263 private JSONArray collectProblems (Map <Source , String > issues , String severity ) {
263264 final JSONArray problems = new JSONArray ();
264265 issues .entrySet ().stream ()
265- .map (e -> new JSONObject ().accumulate ("line" , e .getKey ().line ).accumulate (severity , e .getValue ()))
266+ .map (e -> new JSONObject ()
267+ .accumulate (
268+ "line" ,
269+ Optional .ofNullable (e .getKey ())
270+ .map (it -> it .line )
271+ .orElse (-1 ))
272+ .accumulate (severity , e .getValue ()))
266273 .forEach (problems ::add );
267274 return problems ;
268275 }
You can’t perform that action at this time.
0 commit comments