diff --git a/lib/services/profile_workspace_coordinator.dart b/lib/services/profile_workspace_coordinator.dart index 90846f0..3396d20 100644 --- a/lib/services/profile_workspace_coordinator.dart +++ b/lib/services/profile_workspace_coordinator.dart @@ -212,7 +212,8 @@ class ProfileWorkspaceCoordinator { if (profileId == ConfigProfile.defaultProfileId) { return snapshotCurrentProfile(id: profileId, name: 'Default'); } - return profileManager.getProfile(profileId)!; + return profileManager.getProfile(profileId) ?? + await snapshotCurrentProfile(id: profileId, name: 'Unknown'); } Future exportProfile(ConfigProfile profile) async { @@ -300,7 +301,10 @@ class ProfileWorkspaceCoordinator { return; } final current = profileManager.getProfile(profileManager.activeProfileId); - if (current == null) return; + if (current == null) { + await _persistCurrentState(); + return; + } final snapshot = await snapshotCurrentProfile( id: current.id, name: current.name,