Skip to content

Commit 649eb4e

Browse files
committed
refactor(mqtt): Simplify segment ID validation
1 parent f6b08e6 commit 649eb4e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

backend/lib/mqtt/capabilities/MapSegmentationCapabilityMqttHandle.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class MapSegmentationCapabilityMqttHandle extends CapabilityMqttHandle {
4242

4343
for (const id of reqSegments.segment_ids) {
4444
const segment = robotSegments.find(segm => {
45-
return (segm.id === id || parseInt(segm.id) === id);
45+
return segm.id === `${id}`; // Ensure that it works even if the user incorrectly passes numbers
4646
});
4747
if (!segment) {
4848
throw new Error(`Segment ID does not exist, or map was not loaded: ${id}`);

0 commit comments

Comments
 (0)