Object Is Possibly Undefined Typescript Array