From 9117299eb2de5c04c56fb4d375a846db9b87f755 Mon Sep 17 00:00:00 2001 From: Thomas FORGIONE Date: Mon, 5 Oct 2015 10:20:17 +0200 Subject: [PATCH] Commit --- controllers/prototype/dbrequests.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/controllers/prototype/dbrequests.js b/controllers/prototype/dbrequests.js index 79b526b..05fe9ef 100644 --- a/controllers/prototype/dbrequests.js +++ b/controllers/prototype/dbrequests.js @@ -1029,6 +1029,10 @@ DBReq.LastExpGetter = function(userId, finishAction) { this.finishAction = finishAction; this.finalResult = {}; + if (this.userId === undefined) { + return; + } + pg.connect(pgc.url, function(err, client, release) { self.client = client; self.release = release; @@ -1063,6 +1067,7 @@ DBReq.LastExpGetter.prototype.execute = function() { if (err !== null) { Log.dberror(err + ' in LastExpGetter (DBReq)'); } + if (result.rows.length === 0) { Log.debug('Timeout', true); setTimeout(function() {