Skip to content
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

PolylineGeometryUpdater crash when deleting and re-creating an object position #8521

Closed
shunter opened this issue Jan 9, 2020 · 1 comment · Fixed by #8544
Closed

PolylineGeometryUpdater crash when deleting and re-creating an object position #8521

shunter opened this issue Jan 9, 2020 · 1 comment · Fixed by #8544

Comments

@shunter
Copy link
Contributor

shunter commented Jan 9, 2020

Sandcastle example

(load then click the Test button)

This example creates a polyline via CZML, then processes a second document which deletes one of the endpoint positions, then immediately recreates it.

This crashes:

Sandcastle-client.js:20 TypeError: Cannot read property 'getValueInReferenceFrame' of undefined
    at ReferenceProperty.getValueInReferenceFrame (Cesium.js:128476)
    at PositionPropertyArray.getValueInReferenceFrame (Cesium.js:128013)
    at PositionPropertyArray.getValue (Cesium.js:127979)
    at PolylineGeometryUpdater._onEntityPropertyChanged (Cesium.js:155733)
    at Event.raiseEvent (Cesium.js:12972)
    at Entity.<anonymous> (Cesium.js:80710)
    at Event.raiseEvent (Cesium.js:12972)
    at PolylineGraphics.<anonymous> (Cesium.js:80710)
    at Event.raiseEvent (Cesium.js:12972)
    at PositionPropertyArray._raiseDefinitionChanged (Cesium.js:128063)

This is because PolylineGeometryUpdater.prototype._onEntityPropertyChanged responds to the property being deleted by immediately trying to get the value, and ReferenceProperty crashes when it is asked to get the value.

@mramato do you remember why we made ReferenceProperty crash rather than return undefined? It's been so long that I don't know if there was a reason or not.

@mramato
Copy link
Contributor

mramato commented Jan 16, 2020

The only explanation I have is very early on, we assumed properties were never undefined and that we wanted to "fail fast" instead of letting bad/unexpected data in. Obviously that's changed quite a bit (For the better).

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 a pull request may close this issue.

2 participants