refs #6913 routeKm #2156

Merged
carlossa merged 4 commits from 6913-routeKm into dev 2024-03-14 07:33:58 +00:00
1 changed files with 6 additions and 4 deletions

View File

@ -30,9 +30,11 @@ module.exports = Self => {
});
function validateDistance(err) {
const routeTotalKm = this.kmEnd - this.kmStart;
const routeMaxKm = 4000;
if (routeTotalKm > routeMaxKm || this.kmStart > this.kmEnd)
err();
if (this.kmEnd) {
const routeTotalKm = this.kmEnd - this.kmStart;
const routeMaxKm = 4000;
if (routeTotalKm > routeMaxKm || this.kmStart > this.kmEnd)
err();
}
}
};