mirror of
https://github.com/Eugeny/tabby.git
synced 2025-07-22 03:18:01 +00:00
handle null results from winreg (fixes #174)
This commit is contained in:
@@ -25,7 +25,7 @@ export class Cygwin32ShellProvider extends ShellProvider {
|
|||||||
let cygwinPath = await new Promise<string>(resolve => {
|
let cygwinPath = await new Promise<string>(resolve => {
|
||||||
let reg = new Registry({ hive: Registry.HKLM, key: '\\Software\\Cygwin\\setup', arch: 'x86' })
|
let reg = new Registry({ hive: Registry.HKLM, key: '\\Software\\Cygwin\\setup', arch: 'x86' })
|
||||||
reg.get('rootdir', (err, item) => {
|
reg.get('rootdir', (err, item) => {
|
||||||
if (err) {
|
if (err || !item) {
|
||||||
return resolve(null)
|
return resolve(null)
|
||||||
}
|
}
|
||||||
resolve(item.value)
|
resolve(item.value)
|
||||||
|
@@ -25,7 +25,7 @@ export class Cygwin64ShellProvider extends ShellProvider {
|
|||||||
let cygwinPath = await new Promise<string>(resolve => {
|
let cygwinPath = await new Promise<string>(resolve => {
|
||||||
let reg = new Registry({ hive: Registry.HKLM, key: '\\Software\\Cygwin\\setup', arch: 'x64' })
|
let reg = new Registry({ hive: Registry.HKLM, key: '\\Software\\Cygwin\\setup', arch: 'x64' })
|
||||||
reg.get('rootdir', (err, item) => {
|
reg.get('rootdir', (err, item) => {
|
||||||
if (err) {
|
if (err || !item) {
|
||||||
return resolve(null)
|
return resolve(null)
|
||||||
}
|
}
|
||||||
resolve(item.value)
|
resolve(item.value)
|
||||||
|
@@ -25,7 +25,7 @@ export class GitBashShellProvider extends ShellProvider {
|
|||||||
let gitBashPath = await new Promise<string>(resolve => {
|
let gitBashPath = await new Promise<string>(resolve => {
|
||||||
let reg = new Registry({ hive: Registry.HKLM, key: '\\Software\\GitForWindows' })
|
let reg = new Registry({ hive: Registry.HKLM, key: '\\Software\\GitForWindows' })
|
||||||
reg.get('InstallPath', (err, item) => {
|
reg.get('InstallPath', (err, item) => {
|
||||||
if (err) {
|
if (err || !item) {
|
||||||
resolve(null)
|
resolve(null)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user