diff --git a/app/src/main/java/com/nextcloud/client/preferences/AppPreferencesImpl.java b/app/src/main/java/com/nextcloud/client/preferences/AppPreferencesImpl.java index 0449a103b3..5327730893 100644 --- a/app/src/main/java/com/nextcloud/client/preferences/AppPreferencesImpl.java +++ b/app/src/main/java/com/nextcloud/client/preferences/AppPreferencesImpl.java @@ -437,7 +437,13 @@ public final class AppPreferencesImpl implements AppPreferences { @Override public boolean isDarkModeEnabled() { - return getDarkThemeMode() == DarkMode.DARK; + DarkMode darkMode = getDarkThemeMode(); + + if (darkMode != null) { + return getDarkThemeMode() == DarkMode.DARK; + } else { + return false; + } } @Override diff --git a/app/src/main/java/com/owncloud/android/utils/DisplayUtils.java b/app/src/main/java/com/owncloud/android/utils/DisplayUtils.java index 5cf133be0f..5550e85405 100644 --- a/app/src/main/java/com/owncloud/android/utils/DisplayUtils.java +++ b/app/src/main/java/com/owncloud/android/utils/DisplayUtils.java @@ -856,7 +856,7 @@ public final class DisplayUtils { stopShimmer(shimmerThumbnail, thumbnailView); boolean isAutoUploadFolder = SyncedFolderProvider.isAutoUploadFolder(syncedFolderProvider, file, user); - boolean isDarkModeActive = preferences.getDarkThemeMode() == DarkMode.DARK; + boolean isDarkModeActive = preferences.isDarkModeEnabled(); Integer overlayIconId = file.getFileOverlayIconId(isAutoUploadFolder); LayerDrawable fileIcon = MimeTypeUtil.getFileIcon(isDarkModeActive, overlayIconId, context, viewThemeUtils);