From d1a9160a893030f10c13e46dcf5bbf7501229958 Mon Sep 17 00:00:00 2001
From: John Darrington <john@darrington.wattle.id.au>
Date: Mon, 26 Mar 2012 21:47:41 +0200
Subject: [PATCH] Fix crash on datasets with single values (again)

---
 src/math/histogram.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/math/histogram.c b/src/math/histogram.c
index 94d9852fd7..f2f75e12b3 100644
--- a/src/math/histogram.c
+++ b/src/math/histogram.c
@@ -156,14 +156,14 @@ histogram_create (double bin_width, double min, double max)
   int bins;
   double adjusted_min, adjusted_max;
 
-  assert (bin_width > 0);
-
   if (max == min)
     {
       msg (MW, _("Not creating histogram because the data contains less than 2 distinct values"));
       return NULL;
     }
 
+  assert (bin_width > 0);
+
   bins = adjust_bin_ranges (bin_width, min, max, &adjusted_min, &adjusted_max);
 
   /* Force the number of bins to lie in a sensible range. */
-- 
2.30.2