Merge pull request #5172 from nextcloud/preventNPE

prevent NPE
This commit is contained in:
Tobias Kaminsky 2020-01-14 10:00:51 +01:00 committed by GitHub
commit a8f41615d6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -792,8 +792,11 @@ public class OCFileListFragment extends ExtendedListFragment implements
}
// create rich workspace
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
menu.findItem(R.id.action_create_rich_workspace).setVisible(TextUtils.isEmpty(mFile.getRichWorkspace()));
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP
&& menu.findItem(R.id.action_create_rich_workspace) != null
&& mFile != null) {
menu.findItem(R.id.action_create_rich_workspace).setVisible(
TextUtils.isEmpty(mFile.getRichWorkspace()));
}
}