Fix dereference after null check
CID:248573 (cherry picked from commit af5ec5658cee5293f1083fc71100f1f67fccafc6)