Fixed error on mouseUp, if selection is null

Sometime selection is null, e.g. on click on img.
Merge pull request #68 from medhi/patch-2

Fixed error on mouseUp, if selection is null

Thanks!