Merge pull request #3538 from nextcloud/abortSyncIfNoInternet

if no internet connection, abort sync
This commit is contained in:
Andy Scherzinger 2019-02-01 10:18:48 +01:00 committed by GitHub
commit 454fb0a547
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -190,13 +190,14 @@ public class SynchronizeFileOperation extends SyncOperation {
} else {
/// local copy in the device -> need to think a bit more before do anything
if (mServerFile == null) {
ReadFileRemoteOperation operation = new ReadFileRemoteOperation(mRemotePath);
result = operation.execute(client);
if (result.isSuccess()) {
mServerFile = FileStorageUtils.fillOCFile((RemoteFile) result.getData().get(0));
mServerFile.setLastSyncDateForProperties(System.currentTimeMillis());
} else if (result.getCode() == ResultCode.NO_NETWORK_CONNECTION) {
return result;
}
}