Skip to content

Commit 2cd8950

Browse files
committed
Don't fail if registry key is missing
1 parent 61e9250 commit 2cd8950

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/commands/importFromRegistry.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ async function loadRegistryData(config, serverDefinitions, serversMissingUsernam
6262
const path = hkeyLocalMachine + "\\SOFTWARE" + folder + subFolder;
6363
preloadRegistryCache(cmd, path);
6464
const regData = cmd.runSync("reg query " + path);
65+
if (regData.data === null) {
66+
// e.g., because the key in question isn't there
67+
continue;
68+
}
6569
regData.data.split("\r\n").forEach((serverName) => {
6670
// We only want folders, not keys (e.g., DefaultServer)
6771
if (serverName.indexOf(hkeyLocalMachine) !== 0) {

0 commit comments

Comments
 (0)