Merge pull request #10481 from nextcloud/fix/share-link-crash

FileActivity: fix crash when creating share link from FileDetailsFragment
This commit is contained in:
Tobias Kaminsky 2022-07-07 14:34:09 +02:00 committed by GitHub
commit 97e220a83f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -782,7 +782,7 @@ public abstract class FileActivity extends DrawerActivity
private void onCreateShareViaLinkOperationFinish(CreateShareViaLinkOperation operation,
RemoteOperationResult result) {
FileDetailSharingFragment sharingFragment = getShareFileFragment();
OCFileListFragment fileListFragment = (OCFileListFragment) getSupportFragmentManager().findFragmentByTag(FileDisplayActivity.TAG_LIST_OF_FILES);
final Fragment fileListFragment = getSupportFragmentManager().findFragmentByTag(FileDisplayActivity.TAG_LIST_OF_FILES);
if (result.isSuccess()) {
updateFileFromDB();
@ -806,8 +806,8 @@ public abstract class FileActivity extends DrawerActivity
sharingFragment.onUpdateShareInformation(result, file);
}
if (fileListFragment != null && file != null) {
fileListFragment.updateOCFile(file);
if (fileListFragment instanceof OCFileListFragment && file != null) {
((OCFileListFragment) fileListFragment).updateOCFile(file);
}
} else {
// Detect Failure (403) --> maybe needs password