Explorar o código

add null check to theme util method

AndyScherzinger %!s(int64=7) %!d(string=hai) anos
pai
achega
c4cea4f12b
Modificáronse 1 ficheiros con 4 adicións e 2 borrados
  1. 4 2
      src/main/java/com/owncloud/android/utils/ThemeUtils.java

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

@@ -137,8 +137,10 @@ public class ThemeUtils {
      * @param title     title to be shown
      */
     public static void setColoredTitle(ActionBar actionBar, String title) {
-        String colorHex = colorToHexString(fontColor());
-        actionBar.setTitle(Html.fromHtml("<font color='" + colorHex + "'>" + title + "</font>"));
+        if (actionBar != null) {
+            String colorHex = colorToHexString(fontColor());
+            actionBar.setTitle(Html.fromHtml("<font color='" + colorHex + "'>" + title + "</font>"));
+        }
     }
 
     public static Spanned getColoredTitle(String title, int color) {