Add null check for logger before logging errors in position validation
This commit is contained in:
@@ -427,7 +427,9 @@ class MeasurementContainer {
|
|||||||
return Number.NEGATIVE_INFINITY;
|
return Number.NEGATIVE_INFINITY;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
this.logger.error(`Invalid positionVsParent provided: ${positionString}`);
|
if (this.logger) {
|
||||||
|
this.logger.error(`Invalid positionVsParent provided: ${positionString}`);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -442,7 +444,9 @@ class MeasurementContainer {
|
|||||||
if (positionValue > 0) {
|
if (positionValue > 0) {
|
||||||
return "downstream";
|
return "downstream";
|
||||||
}
|
}
|
||||||
this.logger.error(`Invalid position provided: ${positionValue}`);
|
if (this.logger) {
|
||||||
|
this.logger.error(`Invalid position provided: ${positionValue}`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user