mirror of
https://github.com/nextcloud/android.git
synced 2024-11-30 18:21:10 +03:00
prevent NPE if trying to store grid preference for favorites/shared
This commit is contained in:
parent
fb4374d9fc
commit
fe6171571f
1 changed files with 6 additions and 3 deletions
|
@ -1199,9 +1199,12 @@ public class OCFileListFragment extends ExtendedListFragment implements OCFileLi
|
|||
GRID_IS_PREFERED_PREFERENCE, Context.MODE_PRIVATE
|
||||
);
|
||||
|
||||
SharedPreferences.Editor editor = setting.edit();
|
||||
editor.putBoolean(String.valueOf(mFile.getFileId()), setGrid);
|
||||
editor.apply();
|
||||
// can be in case of favorites, shared
|
||||
if (mFile != null) {
|
||||
SharedPreferences.Editor editor = setting.edit();
|
||||
editor.putBoolean(String.valueOf(mFile.getFileId()), setGrid);
|
||||
editor.apply();
|
||||
}
|
||||
}
|
||||
|
||||
private void unsetAllMenuItems(final boolean unsetDrawer) {
|
||||
|
|
Loading…
Reference in a new issue