diff --git a/CHANGELOG.md b/CHANGELOG.md index a6eec63..24385cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ All notable changes to the "hoi4modutilities" extension will be documented in th Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file. +## Develop + +### Fixed +* Fix a bug that some conditions are treated as scope. + ## [0.11.1] - 2023/11/17 - Latest ### Fixed diff --git a/src/hoiformat/scope.ts b/src/hoiformat/scope.ts index 4fda986..66aab09 100644 --- a/src/hoiformat/scope.ts +++ b/src/hoiformat/scope.ts @@ -24,6 +24,10 @@ export function tryMoveScope(node: Node, scopeStack: Scope[], type: 'condition' return false; } + if (typeof node.value !== 'object' || !Array.isArray(node.value)) { + return false; + } + let nodeName = node.name.trim(); if (nodeName.match(/^[A-Z][A-Z0-9]{2}$/)) { scopeStack.push({