Fixed poll fetching for first poll.

This commit is contained in:
Nick Winter 2015-03-11 09:01:40 -07:00
parent 7b20bf469a
commit a697b35920
2 changed files with 2 additions and 2 deletions

View file

@ -150,7 +150,7 @@ module.exports = class LevelBus extends Bus
return unless @onPoint()
@fireScriptsRef?.update(e)
state = @session.get('state')
scripts = state.scripts
scripts = state.scripts ? {}
scripts.currentScript = e.currentScript
scripts.currentScriptOffset = e.currentScriptOffset
@changedSessionProperties.state = true

View file

@ -32,7 +32,7 @@ PollHandler = class PollHandler extends Handler
@sendSuccess res, @formatEntity(req, poll)
findPollPriority: (lastPollID, callback) ->
return callback null, -9001 unless lastPollID
return callback null, -9001 unless lastPollID and lastPollID isnt '-'
Poll.findById mongoose.Types.ObjectId(lastPollID), 'priority', {lean: true}, (err, poll) ->
callback err, poll?.priority