From 6d3ee13d87f316a2c0263bff249cd56b59fdfd95 Mon Sep 17 00:00:00 2001 From: DanyLE Date: Fri, 19 Aug 2022 16:40:25 +0200 Subject: [PATCH] update base64 handling --- os/controllers/SystemController.lua | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/os/controllers/SystemController.lua b/os/controllers/SystemController.lua index 28b005a..5abe390 100644 --- a/os/controllers/SystemController.lua +++ b/os/controllers/SystemController.lua @@ -132,10 +132,12 @@ function SystemController:apigateway(...) r, e = loadfile(ospath) if r then local status, result = pcall(r, data.parameters) - if (status) then - echo(JSON.encode(result)) - else - echo(result) + if result then + if (status) then + echo(JSON.encode(result)) + else + echo(result) + end end else echo(e)