fix bug when write Switch null

fix bug when write Switch null