Skip to content

Commit

Permalink
Check undefined Iori
Browse files Browse the repository at this point in the history
  • Loading branch information
boyonthebeach2k authored Jun 21, 2024
1 parent 3f0d5b5 commit c6d56b9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/getters/getChargers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,13 @@ const getServants = async (region: "JP" | "CN" | "TW" | "KR" | "NA" = "JP"): Pro

servants.splice(servants.indexOf(servants.find((serv) => serv.id === mash.id)!), 1, mashOG, mashOrtenaus);

const iori = { ...servants.find((serv) => serv.id === 106000)! };
const iori = { ...servants.find((serv) => serv.id === 106000) };

iori.noblePhantasms = iori.noblePhantasms.filter((np) => np.id === 106001);
if (iori) {
iori.noblePhantasms = iori.noblePhantasms.filter((np) => np.id === 106001);

servants.splice(servants.indexOf(servants.find((serv) => serv.id === iori.id)!), 1, iori);
servants.splice(servants.indexOf(servants.find((serv) => serv.id === iori.id)!), 1, iori);
}

return servants;
};
Expand Down

0 comments on commit c6d56b9

Please sign in to comment.