From cc4e710521593c390edd2f3a635380d416cb0c4b Mon Sep 17 00:00:00 2001 From: Piotr Rogowski Date: Thu, 2 Mar 2023 23:32:59 +0100 Subject: [PATCH] Handle global dialogs --- src/ini.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/ini.ts b/src/ini.ts index 1fa6293..6e71807 100644 --- a/src/ini.ts +++ b/src/ini.ts @@ -681,12 +681,10 @@ export class INI implements ParserInterface { P.all, ).parse(line); - if (!this.currentDialog) { - throw new Error('Dialog not set'); - } - - if (helpResult.status) { - this.result.dialogs[this.currentDialog!].help = INI.sanitize(helpResult.value.help); + if (this.currentDialog) { + if (helpResult.status) { + this.result.dialogs[this.currentDialog!].help = INI.sanitize(helpResult.value.help); + } } // TODO: missing fields: