From 5837b614d46a02585d4575eb3cf7214605edda6b Mon Sep 17 00:00:00 2001 From: evazion Date: Fri, 25 Feb 2022 01:58:08 -0600 Subject: [PATCH] artists: fix exception on show page when artist has invalid URLs. Fix an exception on the artist show page when the artist entry contained invalid URLs such as `http://ttp://album.yahoo.co.jp/photos/my/8027988`. Caused by `ArtistUrl#domain` returning nil for certain invalid URLs, which caused `Artist#sorted_urls` to blow up. ref: https://danbooru.donmai.us/forum_posts/206488 --- app/models/artist_url.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/artist_url.rb b/app/models/artist_url.rb index ba0dfb48c..a28e8acb7 100644 --- a/app/models/artist_url.rb +++ b/app/models/artist_url.rb @@ -72,7 +72,7 @@ class ArtistURL < ApplicationRecord end def domain - Danbooru::URL.parse(normalized_url)&.domain + Danbooru::URL.parse(normalized_url)&.domain.to_s end def site_name