From 1a03e581d1e6a8e6ac6b923482dfb15edd969323 Mon Sep 17 00:00:00 2001 From: Boy on the Beach <39589879+boyonthebeach2k@users.noreply.github.com> Date: Fri, 21 Jun 2024 22:56:26 +0530 Subject: [PATCH] Explicit check for undefined Iori --- src/getters/getChargers.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/getters/getChargers.tsx b/src/getters/getChargers.tsx index 9cabaf8..d73c668 100644 --- a/src/getters/getChargers.tsx +++ b/src/getters/getChargers.tsx @@ -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;