Fix the coverity issue (Dereference after null check)