From 5fb7f07498f38d3ecab2da46b744e7473db2eee6 Mon Sep 17 00:00:00 2001 From: Javier Goizueta Date: Thu, 12 May 2016 18:29:30 +0200 Subject: [PATCH] Prevent problems with missing layers in mapconfig --- lib/cartodb/backends/dataview.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cartodb/backends/dataview.js b/lib/cartodb/backends/dataview.js index b5e57f0e..a6b5f549 100644 --- a/lib/cartodb/backends/dataview.js +++ b/lib/cartodb/backends/dataview.js @@ -119,7 +119,7 @@ DataviewBackend.prototype.getDataview = function (mapConfigProvider, user, param mapConfig.obj().layers, function(l){ return l.options.source && (l.options.source.id === sourceId); } ); - var queryRewriteData = layer.options.query_rewrite_data; + var queryRewriteData = layer && layer.options.query_rewrite_data; if ( queryRewriteData ) { if ( node.type === 'source' ) { var filters = node.filters; // TODO: node.getFilters() when available in camshaft