From 774104b34e92c8fc4852ed51fc4e192829ad0822 Mon Sep 17 00:00:00 2001 From: Raul Ochoa Date: Mon, 13 Oct 2014 15:24:14 +0200 Subject: [PATCH] Defaults resultSet to object if undefined in QueryTablesApi --- NEWS.md | 3 +++ lib/cartodb/api/query_tables_api.js | 1 + 2 files changed, 4 insertions(+) diff --git a/NEWS.md b/NEWS.md index 728ad963..3f5d97fe 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,9 @@ 1.18.2 -- 2014-mm-dd -------------------- +Bug fixes: + - Defaults resultSet to object if undefined in QueryTablesApi + 1.18.1 -- 2014-10-13 -------------------- diff --git a/lib/cartodb/api/query_tables_api.js b/lib/cartodb/api/query_tables_api.js index 11a416b8..c6eb2e48 100644 --- a/lib/cartodb/api/query_tables_api.js +++ b/lib/cartodb/api/query_tables_api.js @@ -93,6 +93,7 @@ function runQuery(username, options, query, queryHandler, callback) { if (shouldQueryPostgresDirectly()) { var psql = new PSQL(options); psql.query(query, function(err, resultSet) { + resultSet = resultSet || {}; var rows = resultSet.rows || []; queryHandler(err, rows, callback); });