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

appinstallfixx
Nipuni Kavindya 4 weeks ago
parent 5853e529c7
commit ba3e4623df

@ -122,7 +122,10 @@ public class FileDownloaderServiceProvider {
} }
FileMetaEntry fileMetaEntry = new FileMetaEntry(); 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.setFileName(fileNameSegments[0]);
fileMetaEntry.setExtension(fileNameSegments[1]); fileMetaEntry.setExtension(fileNameSegments[1]);
return fileMetaEntry; return fileMetaEntry;

Loading…
Cancel
Save