Browse Source

Merge pull request #7749 from nextcloud/ezaquarii/fix-crash-in-set-status-dialog

Fix crash in SetStatusDialogFragment.clearTopStatus
Tobias Kaminsky 4 năm trước cách đây
mục cha
commit
af2891a4a7
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() {