diff --git a/core/util.inc.php b/core/util.inc.php index 0dd62e2f..11aa9ae0 100644 --- a/core/util.inc.php +++ b/core/util.inc.php @@ -137,7 +137,9 @@ function clamp($val, $min, $max) { if(!is_null($max) && $val > $max) { $val = $max; } - assert('$val >= $min && $val <= $max', "$min <= $val <= $max"); + if(!is_null($min) && !is_null($max)) { + assert('$val >= $min && $val <= $max', "$min <= $val <= $max"); + } return $val; }