diff --git a/src/EntityRepository.php b/src/EntityRepository.php
index <HASH>..<HASH> 100644
--- a/src/EntityRepository.php
+++ b/src/EntityRepository.php
@@ -42,6 +42,10 @@ class EntityRepository extends Doctrine\ORM\EntityRepository
 	 */
 	public function build(Array $terms = NULL, $order = array(), $limit = NULL, $page = 1)
 	{
+		if (!$order) {
+			$order = array();
+		}
+
 		$builder = $this->createQueryBuilder(static::ALIAS_NAME);
 
 		if ($limit) {
Fix cases where NULL is passed as order