Fix possible crash in User.prototype.can

It crashed if groupData was not found if User object has no group and the user is not in a room.
This commit is contained in:
Juanma Serrano 2015-03-31 17:56:04 +02:00
parent b718c8605d
commit 2f39098cab

View File

@ -615,7 +615,7 @@ User = (function () {
if (typeof target === 'string') targetGroup = target;
if (groupData[permission]) {
if (groupData && groupData[permission]) {
var jurisdiction = groupData[permission];
if (!target) {
return !!jurisdiction;