diff --git a/app/src/main/java/com/zionhuang/music/utils/YTPlayerUtils.kt b/app/src/main/java/com/zionhuang/music/utils/YTPlayerUtils.kt index 7bff95984..5e4c03bcc 100644 --- a/app/src/main/java/com/zionhuang/music/utils/YTPlayerUtils.kt +++ b/app/src/main/java/com/zionhuang/music/utils/YTPlayerUtils.kt @@ -172,10 +172,15 @@ object YTPlayerUtils { } private fun validateStatus(url: String): Boolean { - val requestBuilder = okhttp3.Request.Builder() - .head() - .url(url) - val response = httpClient.newCall(requestBuilder.build()).execute() - return response.isSuccessful + try { + val requestBuilder = okhttp3.Request.Builder() + .head() + .url(url) + val response = httpClient.newCall(requestBuilder.build()).execute() + return response.isSuccessful + } catch (e: Exception) { + reportException(e) + } + return false } } \ No newline at end of file