Check for null session in _publish_msg and _session_default