From bda12fbef802598df113623ccedec211a7d072e4 Mon Sep 17 00:00:00 2001 From: NullSablex <244216261+NullSablex@users.noreply.github.com> Date: Thu, 5 Feb 2026 20:20:59 -0300 Subject: [PATCH] Potential fix for code scanning alert no. 1: Prototype-polluting function Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- src/core/config.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/config.ts b/src/core/config.ts index b005f7a..1f306de 100644 --- a/src/core/config.ts +++ b/src/core/config.ts @@ -146,7 +146,9 @@ export class PawnProConfigManager { let cursor: Record = current; for (let i = 0; i < parts.length - 1; i++) { const key = parts[i]; - if (!isPlainObject(cursor[key])) { + const valueAtKey = cursor[key]; + if (!isPlainObject(valueAtKey)) { + // Ensure we only ever traverse into plain objects cursor[key] = {}; } cursor = cursor[key] as Record;