# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1638723348 0 # Node ID a1fea6b9f3081900b02387446065af1599bab13b # Parent e9ad53d2271bf509515c0d4f829b761fe3cf9c91 Android: Fix potential null pointer exception in mleSetVisible(). Discovered running emulated on Windows. diff -r e9ad53d2271b -r a1fea6b9f308 android/DWindows.kt --- a/android/DWindows.kt Sun Dec 05 15:08:13 2021 +0000 +++ b/android/DWindows.kt Sun Dec 05 16:55:48 2021 +0000 @@ -3019,9 +3019,13 @@ fun mleSetVisible(mle: EditText, line: Int) { waitOnUiThread { - val y: Int = mle.layout.getLineTop(line) - - mle.scrollTo(0, y) + val layout = mle.layout + + if(layout != null) { + val y: Int = layout.getLineTop(line) + + mle.scrollTo(0, y) + } } }