Check if query retrieves results
This commit is contained in:
parent
869f2ac322
commit
0b27d174ef
@ -172,7 +172,8 @@ module.exports = class AggregationMapConfigAdapter {
|
||||
return callback(null, shouldAdapt);
|
||||
}
|
||||
|
||||
const estimatedFeatureCount = res.rows[0].count;
|
||||
const result = res.rows[0] || {};
|
||||
const estimatedFeatureCount = result.count;
|
||||
|
||||
const threshold = layer.options.aggregation && layer.options.aggregation.threshold ?
|
||||
layer.options.aggregation.threshold :
|
||||
@ -182,7 +183,7 @@ module.exports = class AggregationMapConfigAdapter {
|
||||
return callback(null, shouldAdapt);
|
||||
}
|
||||
|
||||
const geometryType = res.rows[0].type;
|
||||
const geometryType = result.type;
|
||||
|
||||
if (geometryType !== 'ST_Point') {
|
||||
return callback(new Error(unsupportedGeometryTypeErrorMessage({ geometryType })));
|
||||
|
Loading…
Reference in New Issue
Block a user