Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

Commit b376fc49 authored by Deucе's avatar Deucе 👌🏾
Browse files

Guard against Seen being undefined when saving config.

parent 5bf7a847
......@@ -1441,21 +1441,23 @@ function save_cfg(lck)
lock_cfg();
cfgfile.rewind();
for(sub in saved_config) {
scpy = JSON.parse(JSON.stringify(saved_config[sub].Seen));
s=saved_config[sub].Seen;
delete saved_config[sub].Seen;
cfgfile.iniSetObject(sub,saved_config[sub]);
if(s != undefined) {
// First, try any "binary" Seen compression
b = binify(s);
cfgfile.iniRemoveSection(sub+'.bseen');
if (b != undefined)
cfgfile.iniSetObject(sub+'.bseen',b);
cfgfile.iniRemoveSection(sub+'.seen');
if (Object.keys(s).length > 0)
cfgfile.iniSetObject(sub+'.seen',s);
if (saved_config[sub].Seen !== undefined) {
scpy = JSON.parse(JSON.stringify(saved_config[sub].Seen));
s=saved_config[sub].Seen;
delete saved_config[sub].Seen;
cfgfile.iniSetObject(sub,saved_config[sub]);
if(s != undefined) {
// First, try any "binary" Seen compression
b = binify(s);
cfgfile.iniRemoveSection(sub+'.bseen');
if (b != undefined)
cfgfile.iniSetObject(sub+'.bseen',b);
cfgfile.iniRemoveSection(sub+'.seen');
if (Object.keys(s).length > 0)
cfgfile.iniSetObject(sub+'.seen',s);
}
saved_config[sub].Seen=scpy;
}
saved_config[sub].Seen=scpy;
}
cfgfile.flush();
if (lck)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment