Skip to content

Commit fb9b576

Browse files
committed
fix(android): CommonLayoutParams measure/layout child guard
1 parent d60e5da commit fb9b576

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

tns-core-modules-widgets/android/widgets/src/main/java/org/nativescript/widgets/CommonLayoutParams.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ protected static int getDesiredHeight(View view) {
9999
// 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.
100100
@SuppressLint("RtlHardcoded")
101101
protected static void layoutChild(View child, int left, int top, int right, int bottom) {
102-
if (child.getVisibility() == View.GONE) {
102+
if (child == null || child.getVisibility() == View.GONE) {
103103
return;
104104
}
105105

@@ -223,7 +223,7 @@ protected static void layoutChild(View child, int left, int top, int right, int
223223
}
224224

225225
protected static void measureChild(View child, int widthMeasureSpec, int heightMeasureSpec) {
226-
if (child.getVisibility() == View.GONE) {
226+
if (child == null || child.getVisibility() == View.GONE) {
227227
return;
228228
}
229229

0 commit comments

Comments
 (0)