From 10afe1f2b59c08e53549c9081d0da9ffc5e69f1f Mon Sep 17 00:00:00 2001 From: epriestley Date: Tue, 30 Apr 2019 06:49:28 -0700 Subject: [PATCH] Fix handling of "null" domain values in Charts Summary: Depends on D20487. If you `min(1, 2, null)`, you get `null`. We want `1`. Test Plan: Viewed a "burnup for project X" chart where one dataseries had no datapoints. Saw a sensible domain selected automatically. Reviewers: amckinley Reviewed By: amckinley Subscribers: yelirekim Differential Revision: https://secure.phabricator.com/D20488 --- .../fact/chart/PhabricatorHigherOrderChartFunction.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/applications/fact/chart/PhabricatorHigherOrderChartFunction.php b/src/applications/fact/chart/PhabricatorHigherOrderChartFunction.php index 519e602a80..aef8f948be 100644 --- a/src/applications/fact/chart/PhabricatorHigherOrderChartFunction.php +++ b/src/applications/fact/chart/PhabricatorHigherOrderChartFunction.php @@ -10,8 +10,12 @@ abstract class PhabricatorHigherOrderChartFunction $domain = $function->getDomain(); if ($domain !== null) { list($min, $max) = $domain; - $minv[] = $min; - $maxv[] = $max; + if ($min !== null) { + $minv[] = $min; + } + if ($max !== null) { + $maxv[] = $max; + } } }