From 8e12e7a819a839042d2e448e3c6b1c86a1bdabad Mon Sep 17 00:00:00 2001 From: Andrew Ellis Date: Fri, 11 May 2012 13:11:02 -0600 Subject: [PATCH] where_nested no longer breaks on closures that don't actually set anything --- laravel/database/query.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/laravel/database/query.php b/laravel/database/query.php index 29370931..607a8627 100644 --- a/laravel/database/query.php +++ b/laravel/database/query.php @@ -414,7 +414,10 @@ class Query { // Once the callback has been run on the query, we will store the nested // query instance on the where clause array so that it's passed to the // query's query grammar instance when building. - $this->wheres[] = compact('type', 'query', 'connector'); + if ($query->wheres !== null) + { + $this->wheres[] = compact('type', 'query', 'connector'); + } $this->bindings = array_merge($this->bindings, $query->bindings);