From 8e4fddddbc91e02a9a53621f5e6511184a5859cb Mon Sep 17 00:00:00 2001 From: "Eldad A. Fux" Date: Fri, 20 Feb 2026 11:24:42 +0100 Subject: [PATCH] Update app/init/resources.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Matej Bačo --- app/init/resources.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/init/resources.php b/app/init/resources.php index 295e6125ae..ef43ab2e09 100644 --- a/app/init/resources.php +++ b/app/init/resources.php @@ -565,8 +565,12 @@ Http::setResource('dbForProject', function (Group $pools, Database $dbForPlatfor return $dbForPlatform; } - $database = $project->getAttribute('database'); - if ($database === null || $database === '') { + if ($project->isEmpty()) { + throw new Exception(Exception::GENERAL_SERVER_ERROR, 'Project is not configured'); + } + + $database = $project->getAttribute('database', ''); + if (empty($database)) { throw new Exception(Exception::GENERAL_SERVER_ERROR, 'Project database is not configured'); }