Missing sessions: throw a proper error message

Instead of the 'Cannot read property ast of undefined'.