This reverts commit 1795e889. Reason for revert: Adding in a fix (null-pointer check) Change-Id: Ic8145c3a6420ffdcfbdd197115b37151d4a77efc