Skip to content

Commit

Permalink
A type class or nil has to respond_to :to_s
Browse files Browse the repository at this point in the history
  • Loading branch information
amatsuda committed Jul 12, 2019
1 parent 00c3f3f commit b2b8972
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions actionview/lib/action_view/helpers/asset_tag_helper.rb
Expand Up @@ -3,7 +3,6 @@
require "active_support/core_ext/array/extract_options"
require "active_support/core_ext/hash/keys"
require "active_support/core_ext/object/inclusion"
require "active_support/core_ext/object/try"
require "action_view/helpers/asset_url_helper"
require "action_view/helpers/tag_helper"

Expand Down Expand Up @@ -268,7 +267,7 @@ def favicon_link_tag(source = "favicon.ico", options = {})
def preload_link_tag(source, options = {})
href = asset_path(source, skip_pipeline: options.delete(:skip_pipeline))
extname = File.extname(source).downcase.delete(".")
mime_type = options.delete(:type) || Template::Types[extname].try(:to_s)
mime_type = options.delete(:type) || Template::Types[extname]&.to_s
as_type = options.delete(:as) || resolve_link_as(extname, mime_type)
crossorigin = options.delete(:crossorigin)
crossorigin = "anonymous" if crossorigin == true || (crossorigin.blank? && as_type == "font")
Expand Down

0 comments on commit b2b8972

Please sign in to comment.