Typescript Array Object Is Possibly Undefined