diff --git a/app/models/link.rb b/app/models/link.rb index 09b7aa05e..9e5ed0232 100644 --- a/app/models/link.rb +++ b/app/models/link.rb @@ -2,7 +2,9 @@ class Link < ApplicationRecord belongs_to :linkable, polymorphic: true def host - URI.parse(url).host + URI.parse(url).host || url + rescue URI::InvalidURIError, URI::InvalidComponentError + url end def site