diff --git a/files/lib/data/room/Room.class.php b/files/lib/data/room/Room.class.php index a45307d..7cb4844 100644 --- a/files/lib/data/room/Room.class.php +++ b/files/lib/data/room/Room.class.php @@ -110,7 +110,7 @@ public function canSee(?UserProfile $user = null, ?\Exception &$reason = null): EventHandler::getInstance()->fireAction($this, 'canSee', $parameters); $reason = $parameters['result']; - if (!($reason === null || $reason instanceof \Exception || $reason instanceof \Throwable)) { + if (!($reason === null || $reason instanceof \Throwable)) { throw new \DomainException('Result of canSee must be a \Throwable or null.'); } @@ -147,7 +147,7 @@ public function canSeeLog(?UserProfile $user = null, ?\Exception &$reason = null EventHandler::getInstance()->fireAction($this, 'canSeeLog', $parameters); $reason = $parameters['result']; - if (!($reason === null || $reason instanceof \Exception || $reason instanceof \Throwable)) { + if (!($reason === null || $reason instanceof \Throwable)) { throw new \DomainException('Result of canSeeLog must be a \Throwable or null.'); } @@ -179,7 +179,7 @@ public function canJoin(?UserProfile $user = null, ?\Exception &$reason = null): EventHandler::getInstance()->fireAction($this, 'canJoin', $parameters); $reason = $parameters['result']; - if (!($reason === null || $reason instanceof \Exception || $reason instanceof \Throwable)) { + if (!($reason === null || $reason instanceof \Throwable)) { throw new \DomainException('Result of canJoin must be a \Throwable or null.'); } @@ -216,7 +216,7 @@ public function canWritePublicly(?UserProfile $user = null, ?\Exception &$reason EventHandler::getInstance()->fireAction($this, 'canWritePublicly', $parameters); $reason = $parameters['result']; - if (!($reason === null || $reason instanceof \Exception || $reason instanceof \Throwable)) { + if (!($reason === null || $reason instanceof \Throwable)) { throw new \DomainException('Result of canWritePublicly must be a \Throwable or null.'); }