Skip to content

fix: check failing if coordinate is 0 - #13

Open
andrezz-b wants to merge 1 commit into
jhcp:masterfrom
andrezz-b:fix-number-check
Open

fix: check failing if coordinate is 0#13
andrezz-b wants to merge 1 commit into
jhcp:masterfrom
andrezz-b:fix-number-check

Conversation

@andrezz-b

Copy link
Copy Markdown

Description

After saving a model which has an element with a coordinate set to 0 the loading of that model will fail. This is because the 0 is treated as a falsy value in addLoadedElement and the if condition is not satisfied.

In my case a dependum had a coordinate 0 and was set left on undefined, then the loading crashed in fileManager.js:348 when accessing dependum.type and the dependum is not defined.

image

Fix

Use typeof to explicitly check that x and y are numbers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant