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; }