Reorder clause to prevent null pointer exception when response is null and try_again is true

This commit is contained in:
Leijurv 2018-02-14 10:47:43 -08:00 committed by GitHub
parent a34ba8a84c
commit 3ee90ac6c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -450,7 +450,7 @@ class DownloadManager(internal var client: TelegramClient?, p: DownloadProgressI
} catch (e: InterruptedException) {
}
} while (offset < size && (response!!.getBytes().getData().size > 0 || try_again))
} while (offset < size && (try_again || response!!.getBytes().getData().size > 0))
fos.close()
if (offset < size) {
System.out.println("Requested file $target with $size bytes, but got only $offset bytes.")