git » sdk » commit 3498841

The JID may be null in the datastore so we can't parse that...

author Stephen Paul Weber
2026-09-01 15:48:16 UTC
committer Stephen Paul Weber
2026-09-01 15:48:16 UTC
parent 5b0197e6071b8e4e2e486804b3719dd273aaf695

The JID may be null in the datastore so we can't parse that...

borogove/persistence/IDB.js +5 -1

diff --git a/borogove/persistence/IDB.js b/borogove/persistence/IDB.js
index c0334b9..a6feaba 100644
--- a/borogove/persistence/IDB.js
+++ b/borogove/persistence/IDB.js
@@ -371,7 +371,11 @@ export default async (dbname, media, tokenize, stemmer) => {
 			raw.photoUri,
 			raw.isSelf ? true : false,
 			raw.roles.map((role) => new borogove_Role(role.id, role.title)),
-			raw.jid instanceof borogove_JID ? raw.jid : borogove_JID.parse(raw.jid),
+			// If raw.jid is undefined this produces an invalid Member
+			// But if all we use that for is applyTo maybe it's ok?
+			!raw.jid || raw.jid instanceof borogove_JID
+				? raw.jid
+				: borogove_JID.parse(raw.jid),
 			new Map(
 				(raw.presence?.entries() ?? []).map(([k, p]) => [
 					k,