From 98cd524c076d27951424d2f8364394ef9df6393f Mon Sep 17 00:00:00 2001 From: Raul Ochoa Date: Mon, 4 Jul 2016 02:15:54 +0200 Subject: [PATCH] Skip null values for quantification methods generating null values --- lib/cartodb/backends/turbo-carto-postgres-datasource.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/cartodb/backends/turbo-carto-postgres-datasource.js b/lib/cartodb/backends/turbo-carto-postgres-datasource.js index f8ea381d..848e5902 100644 --- a/lib/cartodb/backends/turbo-carto-postgres-datasource.js +++ b/lib/cartodb/backends/turbo-carto-postgres-datasource.js @@ -84,6 +84,10 @@ PostgresDatasource.prototype.getRamp = function (column, buckets, method, callba var strategy = method2strategy[methodName]; var ramp = result[0][methodName] || []; + // Skip null values from ramp + // Generated turbo-carto won't be correct, but better to keep it working than failing + // TODO fix cartodb-postgres extension quantification functions + ramp = ramp.filter(function(value) { return value !== null; }); if (strategy !== STRATEGY.EXACT) { ramp = ramp.sort(function(a, b) { return a - b;