diff --git a/src/ui/WorkInProgressRoot.tsx b/src/ui/WorkInProgressRoot.tsx
index b1d2cf871..56b1d96ae 100644
--- a/src/ui/WorkInProgressRoot.tsx
+++ b/src/ui/WorkInProgressRoot.tsx
@@ -41,8 +41,8 @@ export function WorkInProgressRoot(): React.ReactElement {
return (
<>
- You have not joined {player.currentWorkFactionName || "(Faction not found)"} yet or cannot work at this time,
- please try again if you think this should have worked
+ You have not joined {player.currentWorkFactionName || "(Faction not found)"} yet or cannot work at this
+ time, please try again if you think this should have worked
>
@@ -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 (
+ <>
+
+ You cannot work for {player.companyName || "(Company not found)"} at this time, please try again if you
+ think this should have worked
+
+
+ >
+ );
}
- companyRep = comp.playerReputation;
+
+ const companyRep = comp.playerReputation;
function cancel(): void {
player.finishWork(true);