Răsfoiți Sursa

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

Fix crash in SetStatusDialogFragment.clearTopStatus
Tobias Kaminsky 4 ani în urmă
părinte
comite
af2891a4a7

+ 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() {