Browse Source

add null check to theme util method

AndyScherzinger 7 years ago
parent
commit
c4cea4f12b
1 changed files with 4 additions and 2 deletions
  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) {