mirror of
https://github.com/nextcloud/android.git
synced 2024-11-26 23:28:42 +03:00
Merge pull request #4604 from nextcloud/ezaquarii/fix-npe-in-favorites
Fix NPE in Favorites when file has no local storage path
This commit is contained in:
commit
58cac2ab2f
1 changed files with 4 additions and 3 deletions
|
@ -429,9 +429,10 @@ public class OCFileListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
|
|||
itemViewHolder.sharedAvatars.removeAllViews();
|
||||
}
|
||||
|
||||
if (onlyOnDevice) {
|
||||
File localFile = new File(file.getStoragePath());
|
||||
|
||||
// npe fix: looks like file without local storage path somehow get here
|
||||
final String storagePath = file.getStoragePath();
|
||||
if (onlyOnDevice && storagePath != null) {
|
||||
File localFile = new File(storagePath);
|
||||
long localSize;
|
||||
if (localFile.isDirectory()) {
|
||||
localSize = FileStorageUtils.getFolderSize(localFile);
|
||||
|
|
Loading…
Reference in a new issue