Skip to content

Commit

Permalink
Fix error when converting undefined wpt id to index (#452)
Browse files Browse the repository at this point in the history
  • Loading branch information
shueja authored Apr 19, 2024
1 parent 13c2b43 commit fc92f29
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/document/HolonomicPathStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,11 @@ export const HolonomicPathStore = types
.views((self) => {
return {
waypointIdToSavedWaypointId(
waypointId: IWaypointScope
waypointId: IWaypointScope | undefined
): "first" | "last" | number | undefined {
if (waypointId === null || waypointId === undefined) {
return undefined;
}
if (typeof waypointId !== "string") {
const scopeIndex = self.findUUIDIndex(waypointId.uuid);
if (scopeIndex == -1) {
Expand Down

0 comments on commit fc92f29

Please sign in to comment.