Skip to content

Commit 104d54e

Browse files
mabardg
authored andcommitted
Application: fixed error conditions order
1 parent b7c8316 commit 104d54e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Application/Application.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,9 @@ public function createInitialRequest(): Request
108108
$params = $this->router->match($this->httpRequest);
109109
$presenter = $params[UI\Presenter::PRESENTER_KEY] ?? null;
110110

111-
if ($params === null || !is_string($presenter)) {
111+
if ($params === null) {
112112
throw new BadRequestException('No route for HTTP request.');
113-
} elseif ($presenter === null) {
113+
} elseif (!is_string($presenter)) {
114114
throw new Nette\InvalidStateException('Missing presenter in route definition.');
115115
}
116116

0 commit comments

Comments
 (0)