diff --git a/core/client.js b/core/client.js index 49e6e1e4..59ed4e6d 100644 --- a/core/client.js +++ b/core/client.js @@ -473,14 +473,12 @@ function loadFile(name, id) { async function load(path) { let response = await fetch((path || url()) + 'view'); - if (!response.ok) { - if (response.status == 404) { - return null; - } else { - throw new Error(response.status + ' ' + response.statusText); - } + let json; + if (response.ok) { + json = await response.json(); + } else if (response.status != 404) { + throw new Error(response.status + ' ' + response.statusText); } - let json = await response.json(); gFiles = {}; let isApp = false; let promises = [];