comparison android/DWindows.kt @ 2716:a1fea6b9f308

Android: Fix potential null pointer exception in mleSetVisible(). Discovered running emulated on Windows.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sun, 05 Dec 2021 16:55:48 +0000
parents e9ad53d2271b
children 6754e8f70142
comparison
equal deleted inserted replaced
2715:e9ad53d2271b 2716:a1fea6b9f308
3017 } 3017 }
3018 3018
3019 fun mleSetVisible(mle: EditText, line: Int) 3019 fun mleSetVisible(mle: EditText, line: Int)
3020 { 3020 {
3021 waitOnUiThread { 3021 waitOnUiThread {
3022 val y: Int = mle.layout.getLineTop(line) 3022 val layout = mle.layout
3023 3023
3024 mle.scrollTo(0, y) 3024 if(layout != null) {
3025 val y: Int = layout.getLineTop(line)
3026
3027 mle.scrollTo(0, y)
3028 }
3025 } 3029 }
3026 } 3030 }
3027 3031
3028 fun mleSetWordWrap(mle: EditText, state: Int) 3032 fun mleSetWordWrap(mle: EditText, state: Int)
3029 { 3033 {