Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 429f507

Browse files
committed
Added null-check to toString().
1 parent 66894e1 commit 429f507

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/main/java/de/taimos/gpsd4java/types/TPVObject.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -539,8 +539,10 @@ public String toString() {
539539
sb.append(this.speedError);
540540
sb.append(", climbRateError=");
541541
sb.append(this.climbRateError);
542-
sb.append(", mode=");
543-
sb.append(this.mode.name());
542+
if (mode != null) {
543+
sb.append(", mode=");
544+
sb.append(this.mode.name());
545+
}
544546
sb.append("}");
545547
return sb.toString();
546548
}

0 commit comments

Comments
 (0)