From 61420f0d8eb1b4c7170082be8a3fdff9197b545d Mon Sep 17 00:00:00 2001 From: Jose Lorenzo Rodriguez Date: Sat, 9 Feb 2013 15:26:33 +0100 Subject: [PATCH] Fixing a couple failing tests --- lib/Cake/Model/Datasource/Database/Query.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Cake/Model/Datasource/Database/Query.php b/lib/Cake/Model/Datasource/Database/Query.php index f1725e80856..a8aea220b3e 100644 --- a/lib/Cake/Model/Datasource/Database/Query.php +++ b/lib/Cake/Model/Datasource/Database/Query.php @@ -965,7 +965,7 @@ public function orHaving($conditions, $types = []) { * @return Query */ public function limit($num) { - if (!is_object($num)) { + if ($num !== null && !is_object($num)) { $num = (int)$num; } $this->_parts['limit'] = $num; @@ -990,7 +990,7 @@ public function limit($num) { * @return Query */ public function offset($num) { - if (!is_object($num)) { + if ($num !== null && !is_object($num)) { $num = (int)$num; } $this->_parts['offset'] = $num;