uspot: def_captive may not exist

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
This commit is contained in:
Thibaut VARÈNE
2023-06-05 15:31:00 +02:00
committed by John Crispin
parent f770253a52
commit cf8769e4b5
2 changed files with 2 additions and 2 deletions

View File

@@ -6,7 +6,7 @@ let uci = require('uci').cursor();
let config = uci.get_all('uspot');
global.handle_request = function(env) {
if (env.REMOTE_ADDR && +config.def_captive.debug)
if (env.REMOTE_ADDR && +config?.def_captive?.debug)
warn('uspot: ' + env.REMOTE_ADDR + ' - CPD redirect\n');
include('cpd.uc', { env });
};

View File

@@ -90,7 +90,7 @@ return {
},
debug: function(ctx, msg) {
if (+config.def_captive.debug)
if (+config.def_captive?.debug)
this.syslog(ctx, msg);
},