Skip to content

Commit

Permalink
ButtonBar, PageIndicator, TabBar, AdvancedLayoutViewPort: avoid excep…
Browse files Browse the repository at this point in the history
…tion when layout is null (references #124)
  • Loading branch information
joshtynjala committed Jul 19, 2022
1 parent b7f3f9a commit eb1d550
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/feathers/controls/ButtonBar.hx
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,9 @@ class ButtonBar extends FeathersControl {
var oldIgnoreChildChanges = this._ignoreChildChanges;
this._ignoreChildChanges = true;
this._layoutResult.reset();
this.layout.layout(this._layoutItems, this._layoutMeasurements, this._layoutResult);
if (this.layout != null) {
this.layout.layout(this._layoutItems, this._layoutMeasurements, this._layoutResult);
}
this._ignoreChildChanges = oldIgnoreChildChanges;
}

Expand Down
4 changes: 3 additions & 1 deletion src/feathers/controls/PageIndicator.hx
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,9 @@ class PageIndicator extends FeathersControl implements IIndexSelector implements
var oldIgnoreChildChanges = this._ignoreChildChanges;
this._ignoreChildChanges = true;
this._layoutResult.reset();
this.layout.layout(this._layoutItems, this._layoutMeasurements, this._layoutResult);
if (this.layout != null) {
this.layout.layout(this._layoutItems, this._layoutMeasurements, this._layoutResult);
}
this._ignoreChildChanges = oldIgnoreChildChanges;
}

Expand Down
4 changes: 3 additions & 1 deletion src/feathers/controls/TabBar.hx
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,9 @@ class TabBar extends FeathersControl implements IIndexSelector implements IDataS
var oldIgnoreChildChanges = this._ignoreChildChanges;
this._ignoreChildChanges = true;
this._layoutResult.reset();
this.layout.layout(this._layoutItems, this._layoutMeasurements, this._layoutResult);
if (this.layout != null) {
this.layout.layout(this._layoutItems, this._layoutMeasurements, this._layoutResult);
}
this._ignoreChildChanges = oldIgnoreChildChanges;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,9 @@ class AdvancedLayoutViewPort extends FeathersControl implements IViewPort {
this.refreshLayoutProperties();
this.refreshChildren(this._layoutItems);
this._layoutResult.reset();
this._layout.layout(this._layoutItems, this._layoutMeasurements, this._layoutResult);
if (this._layout != null) {
this._layout.layout(this._layoutItems, this._layoutMeasurements, this._layoutResult);
}
this.handleLayoutResult();
}

Expand Down

0 comments on commit eb1d550

Please sign in to comment.