mirror of
https://github.com/HeyPuter/puter.git
synced 2026-09-25 14:46:44 +00:00
fix: add safeguard in case server response is wrong
Docker Image CI / build-and-push-image (push) Has been cancelled
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
release-please / release-please (push) Has been cancelled
test / test (18.x) (push) Has been cancelled
test / test (20.x) (push) Has been cancelled
test / test (22.x) (push) Has been cancelled
Docker Image CI / build-and-push-image (push) Has been cancelled
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
release-please / release-please (push) Has been cancelled
test / test (18.x) (push) Has been cancelled
test / test (20.x) (push) Has been cancelled
test / test (22.x) (push) Has been cancelled
This commit is contained in:
@@ -51,6 +51,13 @@ class KV{
|
||||
}),
|
||||
});
|
||||
const arr_values = await resp.json();
|
||||
if ( ! Array.isArray(arr_values?.result) ) {
|
||||
this.gui_cached.resolve({});
|
||||
setTimeout(() => {
|
||||
this.gui_cached = null;
|
||||
}, 4000);
|
||||
return;
|
||||
}
|
||||
const obj = {};
|
||||
for (let i = 0; i < gui_cache_keys.length; i++) {
|
||||
obj[gui_cache_keys[i]] = arr_values.result[i];
|
||||
|
||||
Reference in New Issue
Block a user