Commit 6e1f10fe authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Protect DbFacade#queryOne against errors.

On error the rows will be null, so do a check before calling rows[0].
parent 682eb669
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -41,7 +41,7 @@ DbFacade.prototype = {
     */
    queryOne: function(sql, params, callback) {
        this.query(sql, params, function(err, rows) {
            callback(err, rows[0]);
            callback(err, rows && rows[0]);
        });
    },