Fix crash when there isn't a session.
Merge remote-tracking branch 'origin/master'