-
Notifications
You must be signed in to change notification settings - Fork 24
fix: don’t attempt to call prop.get() when prop is nullish #25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -493,7 +493,7 @@ export default class View extends Component { | |
| const representationIds = []; | ||
| this.selections.forEach((v) => { | ||
| const { prop } = v.getProperties(); | ||
| const { representationId } = prop.get('representationId'); | ||
| const representationId = prop?.get('representationId').representationId; | ||
| if (representationId) { | ||
| representationIds.push(representationId); | ||
| } | ||
|
|
@@ -511,6 +511,9 @@ export default class View extends Component { | |
| return this.selections.map((v) => { | ||
| const { prop, compositeID, displayPosition } = v.getProperties(); | ||
|
|
||
| // Return false to mark this item for removal | ||
| if (prop == null) return false; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we write
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm used to |
||
|
|
||
| return { | ||
| worldPosition: Array.from( | ||
| this.openglRenderWindow.displayToWorld( | ||
|
|
@@ -525,7 +528,7 @@ export default class View extends Component { | |
| ...prop.get('representationId'), | ||
| ray, | ||
| }; | ||
| }); | ||
| }).filter(Boolean); | ||
| } | ||
| return []; | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if your build pipeline supports the optional chaining operator, I can replace it with something else if not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is, I just checked the
distoutput.