fix(installer): null-defensive WelcomePage heading + guard unreachable modes
This commit is contained in:
@@ -45,10 +45,15 @@ public partial class WelcomePageViewModel : ObservableObject, IInstallerPage
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case InstallerMode.Update:
|
case InstallerMode.Update:
|
||||||
Heading = $"Update ClaudeDo {_context.InstalledVersion} -> {_context.LatestVersion}";
|
Heading = $"Update ClaudeDo {_context.InstalledVersion ?? "?"} -> {_context.LatestVersion ?? "?"}";
|
||||||
Subheading = "Your tasks, config, and database will be preserved. Click Next to continue.";
|
Subheading = "Your tasks, config, and database will be preserved. Click Next to continue.";
|
||||||
InstallDirEditable = false;
|
InstallDirEditable = false; // stay where we were installed
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
// Config and any future modes should never reach the wizard; guard loudly if they do.
|
||||||
|
throw new InvalidOperationException(
|
||||||
|
$"WelcomePage is not valid for installer mode {_context.Mode}");
|
||||||
}
|
}
|
||||||
|
|
||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
|
|||||||
Reference in New Issue
Block a user