Fixed error on mouseUp, if selection is null

Sometime selection is null, e.g. on click on img.