Merge pull request #3248 from phyzical/bugfix/3244

recovery screen fix for when augmenting and working
This commit is contained in:
hydroflame 2022-03-30 19:51:28 -04:00 committed by GitHub
commit 2a0f1ddc98
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -217,11 +217,19 @@ export function WorkInProgressRoot(): React.ReactElement {
if (player.workType == CONSTANTS.WorkTypeCompany) {
const comp = Companies[player.companyName];
let companyRep = 0;
if (comp == null || !(comp instanceof Company)) {
throw new Error(`Could not find Company: ${player.companyName}`);
return (
<>
<Typography variant="h4" color="primary">
You cannot work for {player.companyName || "(Company not found)"} at this time, please try again if you
think this should have worked
</Typography>
<Button onClick={() => router.toTerminal()}>Back to Terminal</Button>
</>
);
}
companyRep = comp.playerReputation;
const companyRep = comp.playerReputation;
function cancel(): void {
player.finishWork(true);