diff --git a/lib/rails/html/scrubbers.rb b/lib/rails/html/scrubbers.rb
index af53db4..a1317ad 100644
--- a/lib/rails/html/scrubbers.rb
+++ b/lib/rails/html/scrubbers.rb
@@ -140,9 +140,7 @@ def scrub_attribute(node, attr_node)
attr_node.node_name
end
- if Loofah::HTML5::SafeList::ATTR_VAL_IS_URI.include?(attr_name)
- return if Loofah::HTML5::Scrub.scrub_uri_attribute(attr_node)
- end
+ return if Loofah::HTML5::SafeList::ATTR_VAL_IS_URI.include?(attr_name) && Loofah::HTML5::Scrub.scrub_uri_attribute(attr_node)
if Loofah::HTML5::SafeList::SVG_ATTR_VAL_ALLOWS_REF.include?(attr_name)
Loofah::HTML5::Scrub.scrub_attribute_that_allows_local_ref(attr_node)