fixed possible null pointer error

Change-Id: I1b3427eb43a1eed71e9a70ce48c6847d7f9acb9f