check for nulls.

This commit is contained in:
Simon Tokumine 2012-05-08 10:52:58 +01:00
parent ac7593a743
commit a382b9f601

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$/)[1];
//sql = (sql != null) ? sql[1] : req.params.sql;
var sql = req.params.sql.match(/^\((.*)\)\sas\scdbq$/);
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'