Added private utility methods to check null pointer

Change-Id: I47c90e5a7a052553f5ec15781bf04632fccaf5d6