From 591788c0df7fd61613f809a2865dd121591d56c7 Mon Sep 17 00:00:00 2001 From: LoveSy Date: Sat, 15 Jan 2022 20:06:26 +0800 Subject: [PATCH] Fix an NPE java.lang.NullPointerException: Attempt to invoke virtual method 'int android.text.Layout.getEllipsisCount(int)' on a null object reference --- app/src/main/java/com/topjohnwu/magisk/ui/home/HomeFragment.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/home/HomeFragment.kt b/app/src/main/java/com/topjohnwu/magisk/ui/home/HomeFragment.kt index f4bacb1f2..d542a931e 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ui/home/HomeFragment.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/home/HomeFragment.kt @@ -26,7 +26,7 @@ class HomeFragment : BaseUIFragment() { private fun checkTitle(text: TextView, icon: ImageView) { text.post { - if (text.layout.getEllipsisCount(0) != 0) { + if (text.layout?.getEllipsisCount(0) != 0) { with (icon) { layoutParams.width = 0 layoutParams.height = 0