Fix possible NPE

Change-Id: I9d7e9019c4caac6ab1e534ef7b6dc84d19400a8f