From af2f4cd8e328275787a519bcc6684bc3993fb9a3 Mon Sep 17 00:00:00 2001 From: Believethehype Date: Wed, 14 Feb 2024 12:22:20 +0100 Subject: [PATCH] catch exception if user is not logged in --- ui/noogle/src/components/Search.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ui/noogle/src/components/Search.vue b/ui/noogle/src/components/Search.vue index 5a6518e..c620f50 100644 --- a/ui/noogle/src/components/Search.vue +++ b/ui/noogle/src/components/Search.vue @@ -413,7 +413,12 @@ async function checkuser(msg){ async function get_user_from_search(name){ name = "\"name\":" + name - let dbclient = store.state.dbclient + + if (store.state.dbclient.database === undefined){ + console.log("not logged in, not getting profile suggestions") + return [] + } + let dbclient = store.state.dbclient let profiles = [] let filter1 = new Filter().kind(0).search(name) let evts = await dbclient.database.query([filter1])