From 26a4a10536fe9bd2315daed622b83705fe88ef9e Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Sun, 30 Jul 2023 20:05:24 +0200 Subject: [PATCH] DbObject: compare id/ints only when not null --- library/Director/Data/Db/DbObject.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/library/Director/Data/Db/DbObject.php b/library/Director/Data/Db/DbObject.php index 5ac6b155..e22b8ff0 100644 --- a/library/Director/Data/Db/DbObject.php +++ b/library/Director/Data/Db/DbObject.php @@ -385,7 +385,10 @@ abstract class DbObject return $this; } if ($key === 'id' || substr($key, -3) === '_id') { - if ((int) $value === (int) $this->properties[$key]) { + if ($value !== null + && $this->properties[$key] !== null + && (int) $value === (int) $this->properties[$key] + ) { return $this; } }