llvm's scan-build likes to check object is not null before calling method and removed one dead assignment. (cherry picked from commit 1be837a6)