From 46c2850260908ddd8205e680c1fc0bd6ca7a9cd8 Mon Sep 17 00:00:00 2001 From: luboslenco Date: Thu, 16 Oct 2025 19:25:04 +0200 Subject: [PATCH] Ensure valid config --- paint/sources/config.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/paint/sources/config.ts b/paint/sources/config.ts index da9cd0df..0857ceba 100644 --- a/paint/sources/config.ts +++ b/paint/sources/config.ts @@ -21,8 +21,11 @@ function config_load() { /// end if (blob != null) { - config_loaded = true; - config_raw = json_parse(sys_buffer_to_string(blob)); + let config_string: string = sys_buffer_to_string(blob); + if (starts_with(config_string, "{\"version\":")) { // Ensure valid config + config_loaded = true; + config_raw = json_parse(config_string); + } } }