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

findbugs: accesses list or array with constant index

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Andy Scherzinger 6 жил өмнө
parent
commit
1930e5dc74

+ 4 - 0
src/main/java/com/owncloud/android/utils/ThemeUtils.java

@@ -128,6 +128,10 @@ public final class ThemeUtils {
     public static int primaryColor(Account account, boolean replaceWhite, Context context) {
         OCCapability capability = getCapability(account, context);
 
+        if (context==null) {
+            return 255;
+        }
+
         try {
             int color = Color.parseColor(capability.getServerColor());
             if (replaceWhite && Color.WHITE == color) {