mirror of
https://github.com/appwrite/appwrite
synced 2026-05-20 23:48:23 +00:00
Fix router error
It's possible for the route to be null (no match) which leads to an error like: ``` appwrite | [Error] Timestamp: 2023-08-30T21:39:58+00:00 appwrite | [Error] Type: Error appwrite | [Error] Message: Call to a member function label() on null appwrite | [Error] File: /usr/src/code/app/controllers/general.php appwrite | [Error] Line: 50 ``` This adds a null check to prevent the error.
This commit is contained in:
parent
589e4f5c7d
commit
24efa0de82
1 changed files with 1 additions and 1 deletions
|
|
@ -47,7 +47,7 @@ Config::setParam('cookieSamesite', Response::COOKIE_SAMESITE_NONE);
|
|||
|
||||
function router(App $utopia, Database $dbForConsole, SwooleRequest $swooleRequest, Request $request, Response $response)
|
||||
{
|
||||
$utopia->getRoute()->label('error', __DIR__ . '/../views/general/error.phtml');
|
||||
$utopia->getRoute()?->label('error', __DIR__ . '/../views/general/error.phtml');
|
||||
|
||||
$host = $request->getHostname() ?? '';
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue