fix: nodeinfoの取得に失敗する問題を修正

This commit is contained in:
usbharu 2024-02-24 15:51:09 +09:00
parent a242748908
commit 5692c62fe5
1 changed files with 1 additions and 1 deletions

View File

@ -43,7 +43,7 @@ class KtorResourceResolveService(
protected suspend fun runResolve(url: String): ResolveResponse { protected suspend fun runResolve(url: String): ResolveResponse {
val httpResponse = httpClient.get(url) val httpResponse = httpClient.get(url)
val contentLength = httpResponse.contentLength() val contentLength = httpResponse.contentLength()
if ((contentLength ?: sizeLimit) >= sizeLimit) { if ((contentLength ?: 0) >= sizeLimit) {
throw RemoteMediaFileSizeException("File size is too large. $contentLength >= $sizeLimit") throw RemoteMediaFileSizeException("File size is too large. $contentLength >= $sizeLimit")
} }
return KtorResolveResponse(httpResponse) return KtorResolveResponse(httpResponse)