diff --git a/src/main/kotlin/dev/usbharu/hideout/core/service/resource/KtorResourceResolveService.kt b/src/main/kotlin/dev/usbharu/hideout/core/service/resource/KtorResourceResolveService.kt index 5a19ec81..f8407b23 100644 --- a/src/main/kotlin/dev/usbharu/hideout/core/service/resource/KtorResourceResolveService.kt +++ b/src/main/kotlin/dev/usbharu/hideout/core/service/resource/KtorResourceResolveService.kt @@ -43,7 +43,7 @@ class KtorResourceResolveService( protected suspend fun runResolve(url: String): ResolveResponse { val httpResponse = httpClient.get(url) val contentLength = httpResponse.contentLength() - if ((contentLength ?: sizeLimit) >= sizeLimit) { + if ((contentLength ?: 0) >= sizeLimit) { throw RemoteMediaFileSizeException("File size is too large. $contentLength >= $sizeLimit") } return KtorResolveResponse(httpResponse)