Safely get a state transition function for  task and do the timeline check earlier.
Safely get a state transition function for  task and do the timeline check earlier.

Fixes Issue 1439.

rhyolight/nupic.son,rhyolight/nupic.son,rhyolight/nupic.son