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

Merge pull request #3730 from nextcloud/fix-npe-in-main-app-fix-storage-path

Fix uninitialized preferences in MainApp
Andy Scherzinger 6 жил өмнө
parent
commit
215d51d170

+ 1 - 1
src/main/java/com/owncloud/android/MainApp.java

@@ -130,7 +130,7 @@ public class MainApp extends MultiDexApplication {
         DisplayUtils.useCompatVectorIfNeeded();
         DisplayUtils.useCompatVectorIfNeeded();
 
 
         sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
         sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
-
+        preferences = PreferenceManager.fromContext(this);
         fixStoragePath();
         fixStoragePath();
 
 
         MainApp.storagePath = sharedPreferences.getString(SettingsActivity.PreferenceKeys.STORAGE_PATH,
         MainApp.storagePath = sharedPreferences.getString(SettingsActivity.PreferenceKeys.STORAGE_PATH,