From 60f40c44c62c048591a6733e38f98ed7b10a2e8c Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Wed, 2 Jun 2021 12:36:25 +1000 Subject: [PATCH] make sure the returned ONS session id is a valid sessionID --- ts/components/session/LeftPaneMessageSection.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ts/components/session/LeftPaneMessageSection.tsx b/ts/components/session/LeftPaneMessageSection.tsx index 173f40772..40f9975fe 100644 --- a/ts/components/session/LeftPaneMessageSection.tsx +++ b/ts/components/session/LeftPaneMessageSection.tsx @@ -368,6 +368,9 @@ export class LeftPaneMessageSection extends React.Component { this.setState({ loading: true }); try { const resolvedSessionID = await SNodeAPI.getSessionIDForOnsName(pubkeyorOns); + if (PubKey.validateWithError(resolvedSessionID)) { + throw new Error('Got a resolved ONS but the returned entry is not a vlaid SessionID'); + } // this is a pubkey await ConversationController.getInstance().getOrCreateAndWait( resolvedSessionID,