From a813bc6fac611649240a2c675e5c711757ddfebc Mon Sep 17 00:00:00 2001 From: MathieuG-P <40181755+Zagrios@users.noreply.github.com> Date: Sun, 24 Jul 2022 02:21:43 +0200 Subject: [PATCH] fix bug --- src/main/services/bs-local-version.service.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/services/bs-local-version.service.ts b/src/main/services/bs-local-version.service.ts index 4de56cd5..be918972 100644 --- a/src/main/services/bs-local-version.service.ts +++ b/src/main/services/bs-local-version.service.ts @@ -65,7 +65,7 @@ export class BSLocalVersionService{ } private getCustomVersions(): BSVersion[]{ - return this.configService.get(this.CUSTOM_VERSIONS_KEY); + return this.configService.get(this.CUSTOM_VERSIONS_KEY) || []; } private deleteCustomVersion(version: BSVersion): void{ @@ -99,11 +99,9 @@ export class BSLocalVersionService{ versions.push(steamVersionDetails ? {...steamVersionDetails, steam: true} : {BSVersion: steamBsVersion, steam: true}); } } - - if(!this.utilsService.folderExist(this.installLocationService.versionsDirectory)){ return versions } + if(!this.utilsService.pathExist(this.installLocationService.versionsDirectory)){ return versions } const folderInInstallation = this.utilsService.listDirsInDir(this.installLocationService.versionsDirectory); - folderInInstallation.forEach(f => { let version = this.remoteVersionService.getVersionDetails(f); if(version){ version = this.getCustomVersions().find(v => v.BSVersion === version.BSVersion && v.name === version.name) ?? version; }