I assume you are hopping a lot because you mentioned store buying.
The inventory returns null or empty sometimes as a result of the loading screen.
I recommend adding
if (getClient().getLoginState() == LoginState.LOADING || getClient().getLoginState() == LoginState.LOADING_MAP) {
return 300;
}
To your loop