Protect against NullPointerException

To fix this issue https://github.com/47deg/android-swipelistview/issues/203

Apologies if I've done something wrong, this is my first PR.