Merge pull request #1576 from matrix-org/luke/throw-on-undefined-group

Throw an error when trying to create a group store with falsey groupId
pull/21833/head
David Baker 2017-11-06 13:02:46 +00:00 committed by GitHub
commit 48def50fec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -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 = {};