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)