Handle no layers case

This commit is contained in:
Raul Ochoa 2015-07-07 23:45:56 +02:00
parent 8a036c79c7
commit b63e697934
2 changed files with 7 additions and 1 deletions

View File

@ -11,6 +11,10 @@ module.exports = MapConfigNamedLayersAdapter;
MapConfigNamedLayersAdapter.prototype.getLayers = function(username, layers, dbMetadata, callback) {
var self = this;
if (!layers) {
return callback(null);
}
var adaptLayersQueue = queue(layers.length);
function adaptLayer(layer, done) {

View File

@ -219,7 +219,9 @@ module.exports = function(serverOptions) {
return callback(err);
}
requestMapConfig.layers = layers;
if (layers) {
requestMapConfig.layers = layers;
}
return callback(null, requestMapConfig, datasource);
}
);