Null pointer bug fixed

Change-Id: I60b7e9f818470b73b2b0f8638b873193457c0a34