Skip to content

Commit

Permalink
check for nulls when looking for ancestors
Browse files Browse the repository at this point in the history
  • Loading branch information
ianharrigan committed Oct 7, 2024
1 parent 330f5ce commit 44e663d
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions haxe/ui/containers/properties/PropertyEditor.hx
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,17 @@ class PropertyEditor extends HBox {
private function onValueChanged(value:Variant) {
var event = new UIEvent(UIEvent.CHANGE);
var property = findAncestor(Property);
property.value = value;
property.dispatch(event);
if (property != null) { // could have been destroyed, or just not attached
property.value = value;
property.dispatch(event);
}

var propertyGrid = findAncestor(PropertyGrid);
var event = new UIEvent(UIEvent.CHANGE);
event.relatedComponent = property;
propertyGrid.dispatch(event);
if (propertyGrid != null) { // could have been destroyed, or just not attached
var event = new UIEvent(UIEvent.CHANGE);
event.relatedComponent = property;
propertyGrid.dispatch(event);
}
}
}

Expand Down

0 comments on commit 44e663d

Please sign in to comment.