Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
Signed-off-by: alperozturk <alper_ozturk@proton.me>
  • Loading branch information
alperozturk96 committed Jun 28, 2024
1 parent 7fe148d commit 28c8ed8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -790,11 +790,14 @@ private void onCreateShareViaLinkOperationFinish(CreateShareViaLinkOperation ope
String link = "";
OCFile file = null;
for (Object object : result.getData()) {
OCShare shareLink = (OCShare) object;
if (TAG_PUBLIC_LINK.equalsIgnoreCase(shareLink.getShareType().name())) {
link = shareLink.getShareLink();
file = getStorageManager().getFileByPath(shareLink.getPath());
break;
if (object instanceof OCShare shareLink) {
ShareType shareType = shareLink.getShareType();

if (shareType != null && TAG_PUBLIC_LINK.equalsIgnoreCase(shareType.name())) {
link = shareLink.getShareLink();
file = getStorageManager().getFileByEncryptedRemotePath(shareLink.getPath());
break;
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1389,7 +1389,13 @@ public void listDirectory(OCFile directory, OCFile file, boolean onlyOnDevice, b

public void updateOCFile(OCFile file) {
List<OCFile> mFiles = mAdapter.getFiles();
mFiles.set(mFiles.indexOf(file), file);
int index = mFiles.indexOf(file);
if (index == -1) {
Log_OC.d(TAG, "File cannot be found in adapter's files");
return;
}

mFiles.set(index, file);
mAdapter.notifyItemChanged(file);
}

Expand Down

0 comments on commit 28c8ed8

Please sign in to comment.