Fix possible warning when session could not be created