refactor code to fix CID 60865 : dereference null return value