diff --git a/src/Aggregation/HistogramAggregation.php b/src/Aggregation/HistogramAggregation.php
index 07d70d025cd1dd29480be25e842e01cc6a3bf2c3..ee52ef42293196cc3f4e2a7b9c5e82f91fb820d7 100644
--- a/src/Aggregation/HistogramAggregation.php
+++ b/src/Aggregation/HistogramAggregation.php
@@ -88,7 +88,11 @@ class HistogramAggregation extends AbstractAggregation
      */
     public function getOrder()
     {
-        return [$this->orderMode => $this->orderDirection];
+        if ($this->orderMode && $this->orderDirection) {
+            return [$this->orderMode => $this->orderDirection];
+        } else {
+            return null;
+        }
     }
 
     /**