fix(installer): null-defensive WelcomePage heading + guard unreachable modes

This commit is contained in:
Mika Kuns
2026-04-15 10:27:30 +02:00
parent da1fe2109a
commit 8d2f7e9907

View File

@@ -45,10 +45,15 @@ public partial class WelcomePageViewModel : ObservableObject, IInstallerPage
break;
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.";
InstallDirEditable = false;
InstallDirEditable = false; // stay where we were installed
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;