JosefNemec/Playnite · error · Exception

Emulator not found.

Error message

Emulator not found.

What it means

Thrown as a generic Exception during emulator-based ROM scanning when database.Emulators[scanner.EmulatorId] returns null. The scanner configuration references an emulator by ID that does not exist in the database's Emulators collection, meaning the emulator was deleted, its ID changed, or the scanner config is stale.

Source

Thrown at source/Playnite/Emulators/Scanner.cs:198

            {
                this.emuDbProvider = emuDbProvider;
            }
        }

        public List<ScannedGame> Scan(
            CancellationToken cancelToken,
            out List<Platform> newPlatforms,
            out List<Region> newRegions,
            Action<string> fileScanCallback = null)
        {
            List<ScannedGame> games;
            newPlatforms = new List<Platform>();
            newRegions = new List<Region>();

            var emulator = database.Emulators[scanner.EmulatorId];
            if (emulator == null)
            {
                throw new Exception("Emulator not found.");
            }

            if (scanner.EmulatorProfileId.IsNullOrEmpty())
            {
                throw new Exception("No emulator profile specified.");
            }

            importedFiles = database.GetImportedRomFiles(emulator.InstallDir);
            var globalScanConfig = database.GetGameScannersSettings();
            var crcExclusions = string.Join(";",
                ListExtensions.Merge(globalScanConfig.CrcExcludeFileTypes, scanner.CrcExcludeFileTypes).
                Select(a => a.ToLower().Trim()).ToHashSet());
            var dirToScan = PlaynitePaths.ExpandVariables(scanner.Directory, emulator.InstallDir, true);

            fileExclusions = ParseExclusions(dirToScan, scanner.ExcludedFiles);
            directoryExclusions = ParseExclusions(dirToScan, scanner.ExcludedDirectories);

            CustomEmulatorProfile customProfile = null;

View on GitHub (pinned to 5911f4e964)

Solutions

  1. Open the scanner configuration and re-select the emulator from the dropdown to update EmulatorId.
  2. Verify the emulator still exists in Playnite's emulator settings; if deleted, recreate it and update the scanner.
  3. If importing scanner configs from another machine, ensure the same emulators are configured first.
  4. Delete the stale scanner config and recreate it with valid references.

Example fix

// before — scanner references a deleted emulator
var emulator = database.Emulators[scanner.EmulatorId];
if (emulator == null) throw new Exception("Emulator not found.");

// after — validate and guide the user
var emulator = database.Emulators[scanner.EmulatorId];
if (emulator == null)
{
    logger.Warn($"Scanner '{scanner.Name}' references missing emulator {scanner.EmulatorId}.");
    // prompt user to reconfigure or skip this scanner
    continue;
}
Defensive patterns

Strategy: validation

Validate before calling

var emulator = database.Emulators[scanner.EmulatorId];
if (emulator == null)
{
    logger.Warn($"Scanner '{scanner.Name}' references missing emulator {scanner.EmulatorId}.");
    continue;
}

Type guard

static bool ScannerEmulatorExists(IGameDatabase database, GameScanner scanner)
{
    return database.Emulators[scanner.EmulatorId] != null;
}

Prevention

When it happens

Trigger: Running a GameScanner whose EmulatorId references an emulator that was deleted from the database. Calling the ScanEmulator method with a scanner config whose EmulatorId is a stale Guid from a previous database or a manually-entered invalid ID.

Common situations: The user deleted the emulator from Playnite but the scanner config still references it. A database import or sync changed emulator IDs. The scanner was configured on one machine and exported to another where the emulator doesn't exist. A database corruption lost the emulator record.

Related errors


AI-assisted analysis of JosefNemec/Playnite@5911f4e964 (2026-08-13). Data as JSON: /api/errors/9fb1bf217a004d76. Report an issue: GitHub.