diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/impl/FileDownloaderServiceProvider.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/impl/FileDownloaderServiceProvider.java index 7c8ad99533..d0ca149bcb 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/impl/FileDownloaderServiceProvider.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/impl/FileDownloaderServiceProvider.java @@ -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;