bugfix: config screen is not populated when alias is empty

This commit is contained in:
Nic Limper
2024-02-26 11:47:56 +01:00
parent d3b9abf56a
commit c458c6b29c
2 changed files with 3 additions and 1 deletions

Binary file not shown.

View File

@@ -726,7 +726,7 @@ document.addEventListener("loadTab", function (event) {
fetch("/get_ap_config")
.then(response => response.json())
.then(data => {
if (data.alias) {
if (data && 'alias' in data) {
apConfig = data;
$('#apcfgalias').value = data.alias;
$('#apcfgchid').value = data.channel;
@@ -1186,6 +1186,8 @@ function processZlib(data) {
const subBuffer = data.subarray(4);
try {
const inflatedBuffer = pako.inflate(subBuffer);
// to constrain window size for testing:
// const inflatedBuffer = pako.inflate(subBuffer, { windowBits: 12 });
const headerSize = inflatedBuffer[0];
return inflatedBuffer.subarray(headerSize);
} catch (err) {