diff --git a/lib/models/SimpleORMap.class.php b/lib/models/SimpleORMap.class.php
index ab2c332a63590ec9ae535a15d26621b5c52ffbe5..476e6462a7ae9e0fe7db44d7d220baef192fc2f3 100644
--- a/lib/models/SimpleORMap.class.php
+++ b/lib/models/SimpleORMap.class.php
@@ -2142,7 +2142,7 @@ class SimpleORMap implements ArrayAccess, Countable, IteratorAggregate
             if ($options['type'] === 'has_many') {
                 $records = function($record) use ($to_call, $params, $options) {
                     $p = (array)$params($record);
-                    return call_user_func_array($to_call, array_merge(count($p) ? $p : [null], [$options['order_by'] ?? '']));
+                    return call_user_func_array($to_call, array_merge(count($p) ? $p : [null], [$options['order_by'] ?? null]));
                 };
                 $this->relations[$relation] = new SimpleORMapCollection($records, $options, $this);
             } elseif ($options['type'] === 'has_and_belongs_to_many') {