Unverified Commit 2dd3cbe3 authored by Sebastian Schüpbach's avatar Sebastian Schüpbach
Browse files

catch other URLMalformedExceptions

parent c691574f
Pipeline #16651 passed with stages
in 6 minutes and 1 second
......@@ -42,7 +42,11 @@ class PreviewImageHandler(private val sftpClient: SftpClient) {
* @return true if URL points to Youtube
*/
fun isYoutubeUrl(url: String): Boolean {
return listOf("youtube.com", "youtu.be").contains(URL(url).host.toLowerCase())
return try {
listOf("youtube.com", "youtu.be").contains(URL(url).host.toLowerCase())
} catch (ex: MalformedURLException) {
false
}
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment