Fix issue accessing an array index on a boolean

This commit is contained in:
Tom Willemse 2024-02-29 09:01:24 -08:00
parent 907fd55a5c
commit e1bfad3df7

View file

@ -103,7 +103,15 @@ class SemanticScuttle_Service_User extends SemanticScuttle_DbService
GENERAL_ERROR, 'Could not get user', GENERAL_ERROR, 'Could not get user',
'', __LINE__, __FILE__, $query, $this->db '', __LINE__, __FILE__, $query, $this->db
); );
return false; return [ 'uId' => 0,
'username' => '',
'name' => '',
'email' => '',
'homepage' => '',
'content' => '',
'datetime' => NULL,
'isAdmin' => false,
'privateKeey' => '' ];
} }
$row = $this->db->sql_fetchrow($dbresult); $row = $this->db->sql_fetchrow($dbresult);
@ -111,7 +119,15 @@ class SemanticScuttle_Service_User extends SemanticScuttle_DbService
if ($row) { if ($row) {
return $row; return $row;
} else { } else {
return false; return [ 'uId' => 0,
'username' => '',
'name' => '',
'email' => '',
'homepage' => '',
'content' => '',
'datetime' => NULL,
'isAdmin' => false,
'privateKeey' => '' ];
} }
} }