Strengthen precondition of `ConversationController.getOrCreate`

pull/1/head
Daniel Gasienica 8 years ago
parent 83c979fb84
commit 08f6886f3e

@ -99,6 +99,14 @@
return conversations.add(attributes);
},
getOrCreate: function(id, type) {
if (typeof id !== 'string') {
throw new TypeError('"id" must be a string');
}
if (type !== 'private' && type !== 'group') {
throw new TypeError('"type" must be "private" or "group"; got: ' + type);
}
if (!this._initialFetchComplete) {
throw new Error('ConversationController.get() needs complete initial fetch');
}

Loading…
Cancel
Save