Skip to content

Commit

Permalink
Fixed NPE caused by null trip or trip id while building block short s…
Browse files Browse the repository at this point in the history
…tring
  • Loading branch information
vesavlad committed Mar 19, 2024
1 parent 97b675c commit b5481b2
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,14 @@ public String toString() {
*/
public String toShortString() {
// Create shortened version of Trip info that only includes the trip_id
String tripsStr = "Trip [" + getTrips().stream().map(Trip::getId).collect(Collectors.joining(", ")) + "]";
String tripIds = getTrips()
.stream()
.filter(Objects::nonNull)
.map(Trip::getId)
.filter(Objects::nonNull)
.collect(Collectors.joining(", "));

String tripsStr = "Trip [" + tripIds + "]";

return "Block ["
+ "blockId="
Expand Down

0 comments on commit b5481b2

Please sign in to comment.