Fix NullPointerException in SessionListener.