Fix coverity defects: Dereference before null check (REVERSE_INULL)