Skip to content

Commit

Permalink
fix(core): Segment IDs should be strings
Browse files Browse the repository at this point in the history
  • Loading branch information
Hypfer committed Apr 1, 2021
1 parent 2129e22 commit 97c832e
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions lib/core/capabilities/MapSegmentationCapability.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,18 @@ class MapSegmentationCapability extends Capability {
async getSegments() {
return this.robot.state.map.layers
.filter(e => e.type === MapLayer.TYPE.SEGMENT)
.map(e => new ValetudoMapSegment({
id: e.metaData.segmentId,
name: e.metaData.name
})
.map(e => {
let id = e.metaData.segmentId;

if (typeof id === "number") {
id = id.toString();
}

return new ValetudoMapSegment({
id: id,
name: e.metaData.name
});
}
);
}

Expand Down

0 comments on commit 97c832e

Please sign in to comment.