Skip to content

Commit 9634c2d

Browse files
committed
Accommodate fields being possibly null
1 parent 374dac4 commit 9634c2d

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/entityViewer.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ namespace EntityViewer {
9696

9797
let data: ListViewItem[] = [
9898
sep('Entity'),
99-
["Id:", entity.id.toString()],
99+
["Id:", entity.id?.toString() ?? "null"],
100100
["Type:", entity.type.toString()],
101101
["Position:", `${entity.x}, ${entity.y}, ${entity.z}`]
102102
];
@@ -113,8 +113,8 @@ namespace EntityViewer {
113113
["Sprite type", car.spriteType.toString()],
114114
["Num. of seats", car.numSeats.toString()],
115115
["Next car on train", car.nextCarOnTrain?.toString() ?? "null"],
116-
["Next car on ride", car.nextCarOnRide.toString()],
117-
["Previous car on ride", car.previousCarOnRide.toString()],
116+
["Next car on ride", car.nextCarOnRide?.toString() ?? "null"],
117+
["Previous car on ride", car.previousCarOnRide?.toString() ?? "null"],
118118
["Current station", car.currentStation.toString()],
119119
["", ""],
120120
["Mass:", car.mass.toString()],

0 commit comments

Comments
 (0)