Эх сурвалжийг харах

parse color in try/catch block

tobiasKaminsky 7 жил өмнө
parent
commit
350d54f614

+ 2 - 2
src/main/java/com/owncloud/android/utils/DisplayUtils.java

@@ -779,9 +779,9 @@ public class DisplayUtils {
     public static int primaryColor() {
         OCCapability capability = getCapability();
 
-        if (!capability.getServerColor().isEmpty()) {
+        try {
             return Color.parseColor(capability.getServerColor());
-        } else {
+        } catch (Exception e) {
             return MainApp.getAppContext().getResources().getColor(R.color.primary);
         }
     }