Order checks to validate if a layer should be adapted

This commit is contained in:
Daniel García Aubert
2017-12-18 18:56:53 +01:00
parent 800870e783
commit 6a36aa1f13
@@ -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);
});
}