diff --git a/partials/structure/layout_start.php b/partials/structure/layout_start.php index 3f7611d..86e6274 100644 --- a/partials/structure/layout_start.php +++ b/partials/structure/layout_start.php @@ -89,8 +89,15 @@ if ($debugEnabled) { const file = select.value; if (!file) { content.innerHTML = '

Log auswählen, um Inhalt zu sehen.

'; return; } fetch('/debug?file=' + encodeURIComponent(file) + '&raw=1') - .then(r => r.text()) + .then(r => { + if (!r.ok) throw new Error('Request failed'); + return r.text(); + }) .then(text => { + if (!text.trim()) { + content.innerHTML = '

Log ist leer.

'; + return; + } const escape = (s) => s .replace(/&/g, '&') .replace(/