Adapted to pylyskom refactorings.
Handle that _get_komsession can return none.