diff --git a/skymp5-client/src/services/services/loadOrderVerificationService.ts b/skymp5-client/src/services/services/loadOrderVerificationService.ts index 31555fe87c..8558f4aa38 100644 --- a/skymp5-client/src/services/services/loadOrderVerificationService.ts +++ b/skymp5-client/src/services/services/loadOrderVerificationService.ts @@ -3,6 +3,7 @@ import { getServerIp, getServerUiPort } from "./skympClient"; import { getScreenResolution } from "../../view/formView"; import { ClientListener, CombinedController, Sp } from "./clientListener"; import { Mod, ServerManifest } from "../messages_http/serverManifest"; +import { logTrace } from "../../logging"; const STATE_KEY = 'loadOrderCheckState'; @@ -136,7 +137,7 @@ export class LoadOrderVerificationService extends ClientListener { const result = []; for (let i = 0; i < getCount(); ++i) { const filename = getAt(i); - const { crc32, size } = this.sp.getFileInfo(filename); + const { crc32, size } = this.getFileInfoSafe(filename); result.push({ filename, crc32, size }); } return result; @@ -152,4 +153,24 @@ export class LoadOrderVerificationService extends ClientListener { printConsole(`#${i} ${JSON.stringify(mod)}`); } }; + + private getFileInfoSafe(filename: string) { + try { + return this.sp.getFileInfo(filename); + } + catch (e) { + // InvalidArgumentException.h, Skyrim Platform + const searchString = 'is not a valid argument'; + + const message = (e as Record).message; + + if (typeof message === "string" && message.includes('is not a valid argument')) { + logTrace(this, `Failed to get file info for`, filename); + return { crc32: 0, size: 0 }; + } + else { + throw e; + } + } + } }