Fix null is not an object error for invalid URLs

Signed-off-by: Julien Eluard <julien.eluard@gmail.com>
This commit is contained in:
Asad Dhamani 2019-02-01 19:22:33 +05:30 committed by Julien Eluard
parent 7b0f68fcdb
commit c2409ad664
No known key found for this signature in database
GPG Key ID: 6FD7DB5437FCBEF6
1 changed files with 1 additions and 1 deletions

View File

@ -81,7 +81,7 @@
(defn check-if-phishing-url [{:keys [history history-index] :as browser}]
(let [history-host (http/url-host (try (nth history history-index) (catch js/Error _)))]
(assoc browser :unsafe? (dependencies/phishing-detect history-host))))
(cond-> browser history-host (assoc :unsafe? (dependencies/phishing-detect history-host)))))
(def ipfs-proto-code "e3")
(def swarm-proto-code "e4")