Fixed possible null pointer exception

The returned string from `intent.getAction()` could be null in some cases.