check for nulls. out

This commit is contained in:
Simon Tokumine 2012-05-08 10:51:51 +01:00
parent 537d5e160d
commit ac7593a743

View File

@ -39,8 +39,8 @@ function generateCacheChannel(req, callback){
callback(channelCache[sql_md5]);
} else{
// strip out windshaft/mapnik inserted sql
var sql = req.params.sql.match(/^\((.*)\)\sas\scdbq$/);
sql = (sql != null) ? sql[1] : req.params.sql;
var sql = req.params.sql.match(/^\((.*)\)\sas\scdbq$/)[1];
//sql = (sql != null) ? sql[1] : req.params.sql;
// build up api string
var sqlapi = api.protocol + '://' + username + '.' + api.host + ':' + api.port + '/api/' + api.version + '/sql'