From 72726e2b0b30ec1886ad98ba91ec9cce66e2e77a Mon Sep 17 00:00:00 2001 From: Gheorghe Pinzaru Date: Wed, 5 Aug 2020 17:28:15 +0300 Subject: [PATCH] Fix ens name hash exception for bad names Fixes #11022 Signed-off-by: Gheorghe Pinzaru --- src/status_im/ethereum/ens.cljs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/status_im/ethereum/ens.cljs b/src/status_im/ethereum/ens.cljs index 7435973158..c2c4f2dfe6 100644 --- a/src/status_im/ethereum/ens.cljs +++ b/src/status_im/ethereum/ens.cljs @@ -28,8 +28,10 @@ (let [[label remainder] (-> s string/lower-case (string/split #"\." 2))] - (ethereum/sha3 (str (namehash remainder) - (subs (ethereum/sha3 label) 2))))))) + (if-not (seq label) + default-namehash + (ethereum/sha3 (str (namehash remainder) + (subs (ethereum/sha3 label) 2)))))))) ;; Registry contract