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
This commit is contained in:
evazion
2022-02-25 01:58:08 -06:00
parent e6ded89f85
commit 5837b614d4

View File

@@ -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