From 59feff8dd5b2adedd2648de1cc3c8eaad1be25c7 Mon Sep 17 00:00:00 2001 From: jberg Date: Fri, 11 Oct 2019 16:13:15 -0700 Subject: [PATCH] Fix for getprivateint/string defaultvalue, check for value, not just section (#944) * Fix for getprivateint defaultvalue, check for value, not just section * fix getprivatestring too --- modern/src/runtime/System.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/modern/src/runtime/System.ts b/modern/src/runtime/System.ts index feae4d90..43dddb52 100644 --- a/modern/src/runtime/System.ts +++ b/modern/src/runtime/System.ts @@ -119,7 +119,10 @@ class System extends MakiObject { } getprivateint(section: string, item: string, defvalue: number): number { - if (!this._privateInt.has(section)) { + if ( + !this._privateInt.has(section) || + !this._privateInt.get(section).has(item) + ) { return defvalue; } // @ts-ignore We know this section exists @@ -630,7 +633,10 @@ class System extends MakiObject { } getprivatestring(section: string, item: string, defvalue: string): string { - if (!this._privateString.has(section)) { + if ( + !this._privateString.has(section) || + !this._privateString.get(section).has(item) + ) { return defvalue; } // @ts-ignore We know the section exists