mirror of
https://github.com/wbbaddons/Tims-Chat.git
synced 2024-12-22 21:40:08 +00:00
Throw an IllegalLinkException if room is null in UserAction
This commit is contained in:
parent
1d40423c91
commit
32ba532bc7
@ -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");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user