From 6a36aa1f1349dbed05b5ad7e55969c3033809847 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Mon, 18 Dec 2017 18:56:53 +0100 Subject: [PATCH] Order checks to validate if a layer should be adapted --- .../mapconfig/adapter/aggregation-mapconfig-adapter.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/cartodb/models/mapconfig/adapter/aggregation-mapconfig-adapter.js b/lib/cartodb/models/mapconfig/adapter/aggregation-mapconfig-adapter.js index 3897121a..c3afa7d0 100644 --- a/lib/cartodb/models/mapconfig/adapter/aggregation-mapconfig-adapter.js +++ b/lib/cartodb/models/mapconfig/adapter/aggregation-mapconfig-adapter.js @@ -116,16 +116,16 @@ module.exports = class AggregationMapConfigAdapter { const result = res.rows[0] || {}; - if (!mapConfig.doesLayerReachThreshold(index, result.count)) { - return callback(null, false); - } - if (!AggregationMapConfig.supportsGeometryType(result.type)) { return callback(new Error(unsupportedGeometryTypeErrorMessage({ geometryType: result.type }))); } + if (!mapConfig.doesLayerReachThreshold(index, result.count)) { + return callback(null, false); + } + callback(null, true); }); }