Fix NullPointerException in getFileMetaEntry method for URLs with chunked transfer encoding.

appinstallfixx
Nipuni Kavindya 3 weeks ago
parent 5853e529c7
commit ba3e4623df

@ -122,7 +122,10 @@ public class FileDownloaderServiceProvider {
}
FileMetaEntry fileMetaEntry = new FileMetaEntry();
fileMetaEntry.setSize(Long.parseLong(Objects.requireNonNull(response.header("Content-Length"))));
String contentLength = response.header("Content-Length");
if (contentLength != null) {
fileMetaEntry.setSize(Long.parseLong(contentLength));
}
fileMetaEntry.setFileName(fileNameSegments[0]);
fileMetaEntry.setExtension(fileNameSegments[1]);
return fileMetaEntry;

Loading…
Cancel
Save