From 403dcbebcd640073030b6e9e8a5b72a17da07fac Mon Sep 17 00:00:00 2001 From: Raul Ochoa Date: Mon, 20 Jun 2016 13:27:39 +0200 Subject: [PATCH] Use an empty array as default value for falsy ramps Fixes #507 --- lib/cartodb/utils/style/postgres-datasource.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cartodb/utils/style/postgres-datasource.js b/lib/cartodb/utils/style/postgres-datasource.js index 16e7ed86..c239192a 100644 --- a/lib/cartodb/utils/style/postgres-datasource.js +++ b/lib/cartodb/utils/style/postgres-datasource.js @@ -81,7 +81,7 @@ PostgresDatasource.prototype.getRamp = function (column, buckets, method, callba } var strategy = method2strategy[methodName]; - var ramp = result[0][methodName]; + var ramp = result[0][methodName] || []; if (strategy !== STRATEGY.EXACT) { ramp = ramp.sort(function(a, b) { return a - b;