Fixed NPE by guarding the reference of variable

Bug: 2395174
1 file changed