{"record":{"id":"b8fa56dfb2ce581a","repo":"JosefNemec/Playnite","slug":"specified-emulator-config-does-t-exists","errorCode":null,"errorMessage":"Specified emulator config does't exists.","messagePattern":"Specified emulator config does't exists\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"source/Playnite/GamesEditor.cs","lineNumber":449,"sourceCode":"                        ProcessStarter.StartUrl(action.Path);\r\n                        break;\r\n                    case GameActionType.File:\r\n                    case GameActionType.Emulator:\r\n                    case GameActionType.Script:\r\n                        using (var scriptRuntime = new PowerShellRuntime(\"Custom action runtime\"))\r\n                        using (var controller = new GenericPlayController(Database, game, scriptRuntime, Application.PlayniteApiGlobal))\r\n                        {\r\n                            if (action.Type == GameActionType.Emulator)\r\n                            {\r\n                                var emulator = Database.Emulators[action.EmulatorId];\r\n                                if (emulator == null)\r\n                                {\r\n                                    throw new Exception($\"Emulator not found.\");\r\n                                }\r\n\r\n                                var prof = emulator.AllProfiles.FirstOrDefault(a => a.Id == action.EmulatorProfileId);\r\n                                var newAction = action.GetClone<GameAction, EmulationPlayAction>();\r\n                                newAction.SelectedEmulatorProfile = prof ?? throw new Exception(\"Specified emulator config does't exists.\");\r\n                                newAction.SelectedRomPath = game.Roms.HasItems() ? game.Roms[0].Path : string.Empty;\r\n                                controller.StartEmulator(newAction, false, new SDK.Events.OnGameStartingEventArgs\r\n                                {\r\n                                    Game = game,\r\n                                    SelectedRomFile = newAction.SelectedRomPath,\r\n                                    SourceAction = action\r\n                                });\r\n                            }\r\n                            else\r\n                            {\r\n                                controller.Start(action, false,  new SDK.Events.OnGameStartingEventArgs\r\n                                {\r\n                                    Game = game,\r\n                                    SourceAction = action\r\n                                });\r\n                            }\r\n                        }\r\n                        break;\r","sourceCodeStart":431,"sourceCodeEnd":467,"githubUrl":"https://github.com/JosefNemec/Playnite/blob/5911f4e964e628aa7a69c2030ab35101afa63067/source/Playnite/GamesEditor.cs#L431-L467","documentation":"Thrown (via ?? throw) when an emulator-type GameAction's EmulatorProfileId does not match any profile in emulator.AllProfiles. The emulator itself exists (error 69 passed), but the specific profile referenced by the action is missing — deleted or replaced since the action was configured.","triggerScenarios":"ActivateAction on an emulator action where emulator.AllProfiles.FirstOrDefault(a => a.Id == action.EmulatorProfileId) returns null. The profile id on the action is stale relative to the emulator's current custom/built-in profiles.","commonSituations":"User edited/deleted an emulator profile after assigning it to a game action; profile ids regenerated on re-import; switching emulator definitions reset profile ids.","solutions":["Check that a profile with action.EmulatorProfileId exists in emulator.AllProfiles before activating.","Re-select the emulator profile on the game action so the id is current.","Provide a repair routine that flags game actions whose EmulatorProfileId is no longer present."],"exampleFix":"// before\nnewAction.SelectedEmulatorProfile = prof ?? throw new Exception(\"Specified emulator config does't exists.\");\n\n// after\nif (prof == null) {\n    Dialogs.ShowMessage(\"The emulator profile for this action no longer exists. Please reconfigure it.\", \"Profile missing\", MessageBoxButton.OK, MessageBoxImage.Warning);\n    return;\n}\nnewAction.SelectedEmulatorProfile = prof;","handlingStrategy":"validation","validationCode":"// Ensure the profile exists before starting an emulator action.\nvar prof = emulator.AllProfiles.FirstOrDefault(a => a.Id == action.EmulatorProfileId);\nif (prof == null) { /* prompt user to reconfigure */ return; }","typeGuard":"static bool ProfileExists(Emulator emu, Guid profileId) =>\n    emu.AllProfiles?.Any(a => a.Id == profileId) == true;","tryCatchPattern":null,"preventionTips":["When editing/deleting profiles, update dependent game actions.","Validate profile references on database load.","Show a repair prompt when an action's profile is missing."],"tags":["game-controller","emulator","dangling-reference","validation"],"backgroundTag":null,"analyzedSha":"5911f4e964e628aa7a69c2030ab35101afa63067","analyzedAt":"2026-08-13T17:38:25.713Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}