Added check if no token specified

My app crashes if no token is specified. 
This PR fixes this error.