From 2e01e181aacc9f2afd9abe5c30f62ec0464ac88c Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Thu, 23 Dec 2021 10:30:20 +0100 Subject: [PATCH] DbObject: exists should return false... ...in case there is no related uuid refs #2434 --- 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 8b260cb8..a55b6c4e 100644 --- a/library/Director/Data/Db/DbObject.php +++ b/library/Director/Data/Db/DbObject.php @@ -1375,8 +1375,11 @@ abstract class DbObject $table = $obj->getTableName(); assert($connection instanceof Db); $uuid = UuidLookup::findUuidForKey($id, $table, $connection, self::$dbObjectStore->getBranch()); + if ($uuid) { + return self::$dbObjectStore->exists($table, $uuid); + } - return self::$dbObjectStore->exists($table, $uuid); + return false; } $obj->setConnection($connection)->setKey($id);