From deb47f94d3dc0ed7f3462d985e92802b42f57ed1 Mon Sep 17 00:00:00 2001 From: Erik Thuning <boooink@gmail.com> Date: Tue, 27 Feb 2024 13:49:42 +0100 Subject: [PATCH] Eliminated a warning due to attempting to index into null --- include/User.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/User.php b/include/User.php index 0792fde..b726956 100644 --- a/include/User.php +++ b/include/User.php @@ -27,11 +27,11 @@ class User extends Entity { throw new Exception('Invalid type'); } execute($find); - $id = result_single($find)['id']; - if($id === null) { + $result = result_single($find); + if(!$result) { throw new Exception("Invalid username '$clue'"); } - $this->id = $id; + $this->id = $result['id']; $this->update_fields(); }