From 023f32bce37896700c346399404e8fd663cad094 Mon Sep 17 00:00:00 2001 From: Shockwave Date: Thu, 2 Nov 2023 08:22:17 +0800 Subject: [PATCH] FORMULAS: Removing the possible exception when gymGains/universityGains is called (#898) --- src/Work/Formulas.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Work/Formulas.ts b/src/Work/Formulas.ts index 2ba890174..fe5305335 100644 --- a/src/Work/Formulas.ts +++ b/src/Work/Formulas.ts @@ -85,7 +85,7 @@ export function calculateFactionExp(person: IPerson, type: FactionWorkType): Wor export function calculateCost(classs: Class, location: Location): number { const serverMeta = serverMetadata.find((s) => s.specialName === location.name); const server = GetServer(serverMeta ? serverMeta.hostname : ""); - const discount = (server as Server).backdoorInstalled ? 0.9 : 1; + const discount = (server as Server)?.backdoorInstalled ? 0.9 : 1; return classs.earnings.money * location.costMult * discount; }