Null check for service stopping

The service seems to be null which is why logout is crashing the app. I
have added a null check so this fixes #22