From 4be632759ba3762f92d42368ebb0aecdf01bce84 Mon Sep 17 00:00:00 2001 From: "Leon.Schmidt" Date: Tue, 11 Aug 2026 19:00:51 +0200 Subject: [PATCH] FIX - isolate custom app JSON payload --- sky_phone/source/client/custom_apps.lua | 3 ++- tests/custom_app_compat_client.lua | 10 ++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/sky_phone/source/client/custom_apps.lua b/sky_phone/source/client/custom_apps.lua index 87b4222..ea0ed2c 100644 --- a/sky_phone/source/client/custom_apps.lua +++ b/sky_phone/source/client/custom_apps.lua @@ -280,7 +280,8 @@ local function normalize_json_payload(payload, maximum_bytes) return nil, "payload_too_large" end - return json.decode(encoded) + local decoded = json.decode(encoded) + return decoded end local function validate_optional_text(value, error_code, maximum_length) diff --git a/tests/custom_app_compat_client.lua b/tests/custom_app_compat_client.lua index 558184d..09353b2 100644 --- a/tests/custom_app_compat_client.lua +++ b/tests/custom_app_compat_client.lua @@ -24,10 +24,16 @@ Config = { } json = { - decode = function() + decode = function(encoded) + if encoded == "null" then + return nil, 5 + end return {} end, - encode = function() + encode = function(value) + if value == nil then + return "null" + end return "{}" end, }