Skip to content

Commit 12fcf48

Browse files
committed
DBC22-5193: follow up crashfix
1 parent 7b869aa commit 12fcf48

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/frontend/src/Components/data/routes.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,9 @@ export const shortenToOneDecimal = (num) => {
187187
}
188188

189189
export const compareRoutes = (route1, route2) => {
190+
if (!route1 && !route2) return true; // Return true if both routes are null
191+
if (!route1 || !route2) return false; // Return false if only one route is null
192+
190193
return shortenToOneDecimal(route1.distance) === shortenToOneDecimal(route2.distance)
191194
}
192195

0 commit comments

Comments
 (0)