Skip to content

Commit 81268eb

Browse files
alperozturk96backportbot[bot]
authored andcommitted
add missing mTransferWasRequested assignment
Signed-off-by: alperozturk <[email protected]>
1 parent f5220ed commit 81268eb

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

Diff for: app/src/main/java/com/owncloud/android/operations/SynchronizeFileOperation.java

+13-8
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ private void requestForDownload(OCFile file) {
304304
final var fileDownloadHelper = FileDownloadHelper.Companion.instance();
305305

306306
if (syncInBackgroundWorker) {
307-
Log_OC.d("InternalTwoWaySyncWork", "download file: " + file.getFileName());
307+
Log_OC.d(TAG, "downloading file without notification: " + file.getFileName());
308308

309309
try {
310310
final var operation = new DownloadFileOperation(mUser, file, mContext);
@@ -313,18 +313,23 @@ private void requestForDownload(OCFile file) {
313313
mTransferWasRequested = true;
314314

315315
String filename = file.getFileName();
316-
if (filename != null) {
317-
if (result.isSuccess()) {
318-
fileDownloadHelper.saveFile(file, operation, getStorageManager());
319-
Log_OC.d(TAG, "requestForDownload completed for: " + file.getFileName());
320-
} else {
321-
Log_OC.d(TAG, "requestForDownload failed for: " + file.getFileName());
322-
}
316+
if (filename == null) {
317+
Log_OC.d(TAG,"filename is null cannot save file");
318+
return;
319+
}
320+
321+
if (result.isSuccess()) {
322+
fileDownloadHelper.saveFile(file, operation, getStorageManager());
323+
Log_OC.d(TAG, "requestForDownload completed for: " + filename);
324+
} else {
325+
Log_OC.d(TAG, "requestForDownload failed for: " + filename);
323326
}
324327
} catch (Exception e) {
325328
Log_OC.d(TAG, "Exception caught at requestForDownload" + e);
326329
}
327330
} else {
331+
Log_OC.d(TAG, "downloading file with notification: " + file.getFileName());
332+
mTransferWasRequested = true;
328333
fileDownloadHelper.downloadFile(mUser, file);
329334
}
330335
}

0 commit comments

Comments
 (0)