Skip to content

Commit

Permalink
fix(android): CommonLayoutParams measure/layout child guard (#7271)
Browse files Browse the repository at this point in the history
  • Loading branch information
manoldonev committed May 22, 2019
1 parent 0aca087 commit 333ab36
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ protected static int getDesiredHeight(View view) {
// We use our own layout method because the one in FrameLayout is broken when margins are set and gravity is CENTER_VERTICAL or CENTER_HORIZONTAL.
@SuppressLint("RtlHardcoded")
protected static void layoutChild(View child, int left, int top, int right, int bottom) {
if (child.getVisibility() == View.GONE) {
if (child == null || child.getVisibility() == View.GONE) {
return;
}

Expand Down Expand Up @@ -223,7 +223,7 @@ protected static void layoutChild(View child, int left, int top, int right, int
}

protected static void measureChild(View child, int widthMeasureSpec, int heightMeasureSpec) {
if (child.getVisibility() == View.GONE) {
if (child == null || child.getVisibility() == View.GONE) {
return;
}

Expand Down

0 comments on commit 333ab36

Please sign in to comment.