Fix on_change's when work is empty

issue3488
review1651002
(transplanted from f92a504764796cf082da78142b720a86e571711d)

--HG--
extra : transplant_source : %F9%2APGdyl%F0%82%DAx%14%2Br%0A%86%E5qq%1D