From a41d190e126797ef7f5fd73cf1fc372dbba3cd0e Mon Sep 17 00:00:00 2001 From: meza <211977+meza@users.noreply.github.com> Date: Tue, 8 Oct 2024 11:03:29 +0100 Subject: [PATCH] fix: undefined name --- biome.json | 4 +--- src/actions/scan.ts | 46 +++++++++++++++++++++++---------------------- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/biome.json b/biome.json index 3032c758..c42cdf08 100644 --- a/biome.json +++ b/biome.json @@ -13,11 +13,9 @@ "indentWidth": 2, "lineWidth": 120, "lineEnding": "lf", - "include": ["**/*.ts", "**/*.json"], - "ignore": [".cache/**", "**/*.snap"], "attributePosition": "auto" }, - "files": { "include": ["**/*.ts", "**/*.json"] }, + "files": { "include": ["**/*.ts", "**/*.json"], "ignore": [".cache/**", "**/*.snap"] }, "linter": { "enabled": true, "rules": { diff --git a/src/actions/scan.ts b/src/actions/scan.ts index d1d477d3..e713d62a 100644 --- a/src/actions/scan.ts +++ b/src/actions/scan.ts @@ -132,28 +132,30 @@ export const processScanResults = ( ); } - unsure.push({ - configuredMod: findInConfiguration( - halfMatching[0].configured?.type, - halfMatching[0].configured?.id, - configuration - ), - configuredInstallation: installationIndex, - newMod: { - type: halfMatching[0].local.platform, - id: halfMatching[0].local.modId, - name: halfMatching[0].remote.name - } as Mod, - installation: { - hash: halfMatching[0].local.mod.hash, - fileName: halfMatching[0].local.mod.fileName, - name: halfMatching[0].remote.name, - type: halfMatching[0].local.platform, - id: halfMatching[0].local.modId, - releasedOn: halfMatching[0].local.mod.releaseDate, - downloadUrl: halfMatching[0].local.mod.downloadUrl - } as ModInstall - }); + if (halfMatching[0].remote) { + unsure.push({ + configuredMod: findInConfiguration( + halfMatching[0].configured?.type, + halfMatching[0].configured?.id, + configuration + ), + configuredInstallation: installationIndex, + newMod: { + type: halfMatching[0].local.platform, + id: halfMatching[0].local.modId, + name: halfMatching[0].remote.name + } as Mod, + installation: { + hash: halfMatching[0].local.mod.hash, + fileName: halfMatching[0].local.mod.fileName, + name: halfMatching[0].remote.name, + type: halfMatching[0].local.platform, + id: halfMatching[0].local.modId, + releasedOn: halfMatching[0].local.mod.releaseDate, + downloadUrl: halfMatching[0].local.mod.downloadUrl + } as ModInstall + }); + } } // ================================================================================================================