Fix coverity issue - Dereference after null check