Going green: prevent TypeError for empty tables/results
This is the intial step to fix https://github.com/CartoDB/carto-vl/issues/1049.
This commit is contained in:
parent
3e261fb353
commit
26e4a05276
@ -71,7 +71,7 @@ function _geometryType(ctx) {
|
||||
const geometryColumn = AggregationMapConfig.getAggregationGeometryColumn();
|
||||
const sqlQuery = _getSQL(ctx, sql => queryUtils.getQueryGeometryType(sql, geometryColumn));
|
||||
return queryUtils.queryPromise(ctx.dbConnection, sqlQuery)
|
||||
.then(res => ({ geometryType: res.rows[0].geom_type }));
|
||||
.then(res => ({ geometryType: (res.rows[0] || {}).geom_type }));
|
||||
}
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user