[#13059] 'Cannot read property' error on scanning invalid key

Signed-off-by: andrey <motor4ik@gmail.com>
This commit is contained in:
andrey 2022-01-28 15:26:29 +01:00
parent 4bf393ec3d
commit dc8cbcde56
No known key found for this signature in database
GPG Key ID: 89B67245FD2F0272
1 changed files with 4 additions and 3 deletions

View File

@ -69,14 +69,15 @@
(defn match-contact-async
[chain {:keys [user-id]} callback]
(let [valid-key (and (spec/valid? :global/public-key user-id)
(not= user-id ens/default-key))]
(let [valid-key (and (spec/valid? :global/public-key user-id)
(not= user-id ens/default-key))]
(cond
(and valid-key)
(callback {:type :contact
:public-key user-id})
(and (not valid-key) (string? user-id))
(and (not valid-key) (string? user-id) (not (string/blank? user-id))
(not= user-id "0x"))
(let [registry (get ens/ens-registries chain)
ens-name (resolver/ens-name-parse user-id)
on-success #(match-contact-async chain {:user-id %} callback)]