Browse Source

Fix crash in SetStatusDialogFragment.clearTopStatus

Fix #7741

Signed-off-by: Chris Narkiewicz <hello@ezaquarii.com>
Chris Narkiewicz 4 năm trước cách đây
mục cha
commit
2fc47c243a
1 tập tin đã thay đổi với 7 bổ sung6 xóa
  1. 7 6
      src/main/java/com/nextcloud/ui/SetStatusDialogFragment.kt

+ 7 - 6
src/main/java/com/nextcloud/ui/SetStatusDialogFragment.kt

@@ -344,12 +344,13 @@ class SetStatusDialogFragment :
     }
 
     private fun clearTopStatus() {
-        val grey = resources.getColor(R.color.grey_200)
-
-        onlineStatus.setBackgroundColor(grey)
-        awayStatus.setBackgroundColor(grey)
-        dndStatus.setBackgroundColor(grey)
-        invisibleStatus.setBackgroundColor(grey)
+        context?.let {
+            val grey = it.resources.getColor(R.color.grey_200)
+            onlineStatus.setBackgroundColor(grey)
+            awayStatus.setBackgroundColor(grey)
+            dndStatus.setBackgroundColor(grey)
+            invisibleStatus.setBackgroundColor(grey)
+        }
     }
 
     private fun setStatusMessage() {