From 1190c5de2b94d79df42f3364213c1141500065fe Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 25 Oct 2022 18:13:35 +0200 Subject: [PATCH] adding a crashfix --- .../com/simplemobiletools/launcher/views/HomeScreenGrid.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/launcher/views/HomeScreenGrid.kt b/app/src/main/kotlin/com/simplemobiletools/launcher/views/HomeScreenGrid.kt index 4180b12..1e97b52 100644 --- a/app/src/main/kotlin/com/simplemobiletools/launcher/views/HomeScreenGrid.kt +++ b/app/src/main/kotlin/com/simplemobiletools/launcher/views/HomeScreenGrid.kt @@ -510,8 +510,12 @@ class HomeScreenGrid(context: Context, attrs: AttributeSet, defStyle: Int) : Rel private fun getFakeHeight() = height - sideMargins.top - sideMargins.bottom @SuppressLint("DrawAllocation") - override fun onDraw(canvas: Canvas) { + override fun onDraw(canvas: Canvas?) { super.onDraw(canvas) + if (canvas == null) { + return + } + if (cellXCoords.isEmpty()) { fillCellSizes() }