diff --git a/src/main/kotlin/com/lagradost/cloudstream3/gradle/tasks/Tasks.kt b/src/main/kotlin/com/lagradost/cloudstream3/gradle/tasks/Tasks.kt index be191ac..2420d51 100644 --- a/src/main/kotlin/com/lagradost/cloudstream3/gradle/tasks/Tasks.kt +++ b/src/main/kotlin/com/lagradost/cloudstream3/gradle/tasks/Tasks.kt @@ -127,14 +127,13 @@ fun registerTasks(project: Project) { zip.destinationDirectory.set(project.buildDir) it.doLast { task -> - extension.fileSize = task.outputs.files.singleFile.length() - task.logger.lifecycle("Made Cloudstream package at ${task.outputs.files.singleFile}") - } - - it.finalizedBy { - if (extension.fileSize == null) { + try { + extension.fileSize = task.outputs.files.singleFile.length() + } + catch(Exception e) { extension.fileSize = -1L } + task.logger.lifecycle("Made Cloudstream package at ${task.outputs.files.singleFile}") } } }