From ab953a4ecdbeb6a730d59dd10614c733a218983d Mon Sep 17 00:00:00 2001 From: Alexander Guryanov Date: Thu, 29 Aug 2024 14:22:38 +0300 Subject: [PATCH] Fix InitFs protocol --- src/protocol/protocol.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/protocol/protocol.ts b/src/protocol/protocol.ts index c7027c6..391d6e0 100644 --- a/src/protocol/protocol.ts +++ b/src/protocol/protocol.ts @@ -213,13 +213,15 @@ export class CommandInterfaceOverTransportLayer implements CommandInterface { const fileEntry = next as InitFileEntry; const dosConfig = next as DosConfig; - if (dosConfig.jsdosConf.version !== undefined) { + if (dosConfig.jsdosConf?.version !== undefined) { await sendData("file", ".jsdos/dosbox.conf", encoder.encode(dosConfig.dosboxConf)); await sendData("file", ".jsdos/jsdos.json", encoder.encode(JSON.stringify(dosConfig.jsdosConf, null, 2))); } else if (fileEntry.path !== undefined) { await sendData("file", fileEntry.path, fileEntry.contents); + } else { + console.error("Unknown init part", next); } } }