Update cobalt.js

This commit is contained in:
wukko 2022-09-04 11:32:06 +06:00
parent 5087665a5e
commit 378e1d2118

View file

@ -73,7 +73,7 @@ if (fs.existsSync('./.env')) {
res.status(j.status).json(j.body);
} else {
let j = apiJSON(3, { t: loc(languageCode(req), 'ErrorNoLink', process.env.selfURL) })
if (!j === undefined && j.status && j.body) {
if (!typeof j === "undefined" && j.status && j.body) {
res.status(j.status).json(j.body);
} else {
res.status(500).json({ 'status': 'error', 'text': loc(languageCode(req), 'ErrorUnknownStatus') })