fixed potential null dereference analyzer warnings