Skip to content

Commit

Permalink
Explicit check for undefined Iori
Browse files Browse the repository at this point in the history
  • Loading branch information
boyonthebeach2k authored Jun 21, 2024
1 parent 4164d8d commit 1a03e58
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/getters/getChargers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,10 @@ const getServants = async (region: "JP" | "CN" | "TW" | "KR" | "NA" = "JP"): Pro

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

if (iori) {
iori.noblePhantasms = iori.noblePhantasms!.filter((np) => np.id === 106001)!;
if (iori !== undefined) {
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 1a03e58

Please sign in to comment.