1
0
mirror of https://github.com/wbbaddons/Tims-Chat.git synced 2024-12-21 21:30:08 +00:00

Throw an IllegalLinkException if room is null in UserAction

This commit is contained in:
Maximilian Mader 2014-12-13 16:15:41 +01:00
parent 1d40423c91
commit 32ba532bc7

View File

@ -27,7 +27,8 @@ public function validatePrepareInvite() {
$room = \chat\data\room\RoomCache::getInstance()->getRoom(WCF::getUser()->chatRoomID);
if (!$room || !$room->canEnter()) throw new \wcf\system\exception\PermissionDeniedException();
if ($room === null) throw new \wcf\system\exception\IllegalLinkException();
if (!$room->canEnter()) throw new \wcf\system\exception\PermissionDeniedException();
}
/**
@ -62,7 +63,8 @@ public function validateInvite() {
$this->room = \chat\data\room\RoomCache::getInstance()->getRoom(WCF::getUser()->chatRoomID);
if (!$this->room || !$this->room->canEnter()) throw new \wcf\system\exception\PermissionDeniedException();
if ($this->room === null) throw new \wcf\system\exception\IllegalLinkException();
if (!$this->room->canEnter()) throw new \wcf\system\exception\PermissionDeniedException();
if (!isset($this->parameters['recipients'])) throw new \wcf\system\exception\UserInputException("recipients");
}