Always call set_state null when set_state raised an exception.