Clean up critical Sonar warnings

https://trello.com/c/sfAuv3lS

Cleaned errors:
* Correctness - Possible null pointer dereference in method on exception path

Change-Id: I4b687e5a641fbee41f8e5a156d239955b65a9e21