Commit 591788c0 authored by LoveSy's avatar LoveSy Committed by John Wu

Fix an NPE

java.lang.NullPointerException: Attempt to invoke virtual method 'int android.text.Layout.getEllipsisCount(int)' on a null object reference
parent 571b8986
...@@ -26,7 +26,7 @@ class HomeFragment : BaseUIFragment<HomeViewModel, FragmentHomeMd2Binding>() { ...@@ -26,7 +26,7 @@ class HomeFragment : BaseUIFragment<HomeViewModel, FragmentHomeMd2Binding>() {
private fun checkTitle(text: TextView, icon: ImageView) { private fun checkTitle(text: TextView, icon: ImageView) {
text.post { text.post {
if (text.layout.getEllipsisCount(0) != 0) { if (text.layout?.getEllipsisCount(0) != 0) {
with (icon) { with (icon) {
layoutParams.width = 0 layoutParams.width = 0
layoutParams.height = 0 layoutParams.height = 0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment