From 73297feb826173cd0cd1a15e09e102618e060e2d Mon Sep 17 00:00:00 2001 From: Victor Westerlund Date: Sat, 30 Aug 2025 09:49:14 +0200 Subject: [PATCH] fix: use `isset()` when checking table property value (#52) We can't access the `$this->table` property before initialization, so let's use `isset()` to check if the property has a value. Reviewed-on: https://codeberg.org/vlw/php-mysql/pulls/52 --- src/MySQL.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MySQL.php b/src/MySQL.php index a7deac6..b30ac5a 100644 --- a/src/MySQL.php +++ b/src/MySQL.php @@ -35,7 +35,7 @@ */ private function throw_if_no_table() { - if (!$this->table) { + if (!isset($this->table)) { throw new Exception("No table name defined"); } }