From febeb0429eb9c582bf24cf60a14a26053c509b24 Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Mon, 6 Nov 2017 10:18:10 +0000 Subject: [PATCH] Throw an error when trying to create a group store with falsey groupId --- src/stores/GroupStore.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/stores/GroupStore.js b/src/stores/GroupStore.js index 2578d373a7..11dd664053 100644 --- a/src/stores/GroupStore.js +++ b/src/stores/GroupStore.js @@ -33,6 +33,9 @@ export default class GroupStore extends EventEmitter { constructor(matrixClient, groupId) { super(); + if (!groupId) { + throw new Error('GroupStore needs a valid groupId to be created'); + } this.groupId = groupId; this._matrixClient = matrixClient; this._summary = {};