Browse Source

where_nested no longer breaks on closures that don't actually set anything

Andrew Ellis 12 years ago
parent
commit
8e12e7a819
1 changed files with 4 additions and 1 deletions
  1. 4 1
      laravel/database/query.php

+ 4 - 1
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);