Add some checks to prevent NPE

See: [AGDROID-336](https://issues.jboss.org/browse/AGDROID-336)

## How to I test it?
* Try run [Chuck Norris Joke](https://github.com/aerogear/aerogear-android-cookbook/pull/23) without it