mirror of
https://github.com/status-im/status-mobile.git
synced 2025-02-07 06:15:27 +00:00
[#13059] 'Cannot read property' error on scanning invalid key
Signed-off-by: andrey <motor4ik@gmail.com>
This commit is contained in:
parent
4bf393ec3d
commit
dc8cbcde56
@ -69,14 +69,15 @@
|
|||||||
|
|
||||||
(defn match-contact-async
|
(defn match-contact-async
|
||||||
[chain {:keys [user-id]} callback]
|
[chain {:keys [user-id]} callback]
|
||||||
(let [valid-key (and (spec/valid? :global/public-key user-id)
|
(let [valid-key (and (spec/valid? :global/public-key user-id)
|
||||||
(not= user-id ens/default-key))]
|
(not= user-id ens/default-key))]
|
||||||
(cond
|
(cond
|
||||||
(and valid-key)
|
(and valid-key)
|
||||||
(callback {:type :contact
|
(callback {:type :contact
|
||||||
:public-key user-id})
|
: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)
|
(let [registry (get ens/ens-registries chain)
|
||||||
ens-name (resolver/ens-name-parse user-id)
|
ens-name (resolver/ens-name-parse user-id)
|
||||||
on-success #(match-contact-async chain {:user-id %} callback)]
|
on-success #(match-contact-async chain {:user-id %} callback)]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user