diff --git a/src/pages/honkai3rd/stigmata/[stigmataId].tsx b/src/pages/honkai3rd/stigmata/[stigmataId].tsx index 3dbc627e..7ac86a45 100644 --- a/src/pages/honkai3rd/stigmata/[stigmataId].tsx +++ b/src/pages/honkai3rd/stigmata/[stigmataId].tsx @@ -38,7 +38,9 @@ export async function getStaticProps({ type: 'single', stigmataData: stigmataData, stigmataSetList: ( - getStigmataListBySetId(stigmataData.set!, locale) || [] + (stigmataData.set != null && + getStigmataListBySetId(stigmataData.set!, locale)) || + [] ).sort((a, b) => -a.type.localeCompare(b.type)), stigmataSet: getStigmataSetBySetId(stigmataData.set!, locale) || null, ...(await getI18NProps(locale)), diff --git a/src/server/data/honkai3rd/elysianRealm.ts b/src/server/data/honkai3rd/elysianRealm.ts index 0e75ee97..9ad9dc83 100644 --- a/src/server/data/honkai3rd/elysianRealm.ts +++ b/src/server/data/honkai3rd/elysianRealm.ts @@ -70,7 +70,7 @@ export function getSignetGroupById(id: string, locale = 'en-US') { let cachedSupports: any = null export function getSupportBattlesuits(locale?: string): SupportBattlesuit[] { - if (cachedSignetGroupMap == null) { + if (cachedSupports == null) { cachedSupports = yaml.parse( fs .readFileSync( @@ -97,7 +97,7 @@ export function getSupportBattlesuits(locale?: string): SupportBattlesuit[] { let cachedSigils: any = null export function getRemembranceSigils(locale?: string): RemembranceSigil[] { - if (cachedSignetGroupMap == null) { + if (cachedSigils == null) { cachedSigils = yaml.parse( fs .readFileSync(path.join(process.cwd(), 'data/honkai3rd/er-sigils.yaml')) diff --git a/src/server/data/honkai3rd/stigmata.ts b/src/server/data/honkai3rd/stigmata.ts index 02781742..4a5abe9e 100644 --- a/src/server/data/honkai3rd/stigmata.ts +++ b/src/server/data/honkai3rd/stigmata.ts @@ -120,9 +120,11 @@ export function getStigmataSetBySetId(setId: string, locale?: string) { } export function getStigmataListBySetId(setId: string, locale?: string) { - return ['top', 'mid', 'bot'].map((type) => { - return getStigmaById(setId + '-' + type, locale)! - }) + return ['top', 'mid', 'bot'] + .map((type) => { + return getStigmaById(setId + '-' + type, locale)! + }) + .filter((stigma) => stigma != null) } export function getStigmataMapByIds(idList: string[], locale?: string) {