fix null reference error

https://github.com/iosscripts/iosslider/issues/285