about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--app/helpers/domain_control_helper.rb8
1 files changed, 3 insertions, 5 deletions
diff --git a/app/helpers/domain_control_helper.rb b/app/helpers/domain_control_helper.rb
index 765ffa536..d061de492 100644
--- a/app/helpers/domain_control_helper.rb
+++ b/app/helpers/domain_control_helper.rb
@@ -12,11 +12,9 @@ module DomainControlHelper
       end
     end
 
-    if whitelist_mode?
-      !DomainAllow.allowed?(domain)
-    else
-      DomainBlock.blocked?(domain)
-    end
+    !DomainAllow.allowed?(domain) || DomainBlock.blocked?(domain)
+  rescue Addressable::URI::InvalidURIError, IDN::Idna::IdnaError
+    nil
   end
 
   def whitelist_mode?