Check that prev is not null to avoid NPE.
Merge pull request #12 from cyberpython/pan_mouse_listener_npe_fix

Check that prev is not null to avoid NPE.