I want to ignore the ArrayIndexOutOfBoundsException: 0. I want to go further if the port1[1] is not empty.
if (port1[1] != null){
String[] inputArray1=port1[1].split(",");
Map meInputs1 = Stream.of(inputArray1)
.map(s -> s.split(":",2))
.collect(Collectors.groupingBy(s -> s[0],
Collectors.mapping(s -> s[1],
Collectors.toList())));
}
I get this error at the first line of my code
java.lang.ArrayIndexOutOfBoundsException: 0
How do I skip this if the item I am pointing to is empty?