From 57b36106f87c7b1d169db2b39a0a65de97d7e994 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Fri, 30 Oct 2020 12:31:34 +0100 Subject: [PATCH] Make everything no-empty clean --- wcfsetup/install/files/js/WoltLabSuite/Core/Ajax/Request.js | 4 +++- wcfsetup/install/files/js/WoltLabSuite/Core/Devtools.js | 4 +++- wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Search/Page.js | 4 +++- wcfsetup/install/files/ts/WoltLabSuite/Core/Ajax/Request.ts | 4 +++- wcfsetup/install/files/ts/WoltLabSuite/Core/Devtools.ts | 4 +++- wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Search/Page.ts | 4 +++- 6 files changed, 18 insertions(+), 6 deletions(-) diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ajax/Request.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ajax/Request.js index 5486296c0a..3ee58dde0f 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ajax/Request.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ajax/Request.js @@ -221,7 +221,9 @@ define(["require", "exports", "tslib", "./Status", "../Core", "../Dom/Change/Lis try { data = JSON.parse(xhr.responseText); } - catch (e) { } + catch (e) { + // Ignore JSON parsing failure. + } let showError = true; if (typeof options.failure === "function") { showError = options.failure(data || {}, xhr.responseText || "", xhr, options.data); diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Devtools.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Devtools.js index b6261f969a..d8d04ecb37 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Devtools.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Devtools.js @@ -66,7 +66,9 @@ define(["require", "exports"], function (require, exports) { _settings = JSON.parse(settings); } } - catch (e) { } + catch (e) { + // Ignore JSON parsing failure. + } if (!_settings.editorAutosave) Devtools.toggleEditorAutosave(true); if (_settings.eventLogging) diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Search/Page.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Search/Page.js index e4ffc91246..aac7f6be6f 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Search/Page.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Search/Page.js @@ -33,7 +33,9 @@ define(["require", "exports", "tslib", "../../Core", "../../Dom/Traverse", "../. }); } } - catch (e) { } + catch (e) { + // Ignore JSON parsing failure. + } if (objectType) { parameters.set("types[]", objectType); } diff --git a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ajax/Request.ts b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ajax/Request.ts index 70ae46425e..e12e8fca9c 100644 --- a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ajax/Request.ts +++ b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ajax/Request.ts @@ -264,7 +264,9 @@ class AjaxRequest { let data: ResponseData | null = null; try { data = JSON.parse(xhr.responseText); - } catch (e) {} + } catch (e) { + // Ignore JSON parsing failure. + } let showError = true; if (typeof options.failure === "function") { diff --git a/wcfsetup/install/files/ts/WoltLabSuite/Core/Devtools.ts b/wcfsetup/install/files/ts/WoltLabSuite/Core/Devtools.ts index aca831d041..62e8b0c685 100644 --- a/wcfsetup/install/files/ts/WoltLabSuite/Core/Devtools.ts +++ b/wcfsetup/install/files/ts/WoltLabSuite/Core/Devtools.ts @@ -78,7 +78,9 @@ const Devtools = { if (settings !== null) { _settings = JSON.parse(settings); } - } catch (e) {} + } catch (e) { + // Ignore JSON parsing failure. + } if (!_settings.editorAutosave) Devtools.toggleEditorAutosave(true); if (_settings.eventLogging) Devtools.toggleEventLogging(true); diff --git a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Search/Page.ts b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Search/Page.ts index 8f06c2da2c..6f69d68697 100644 --- a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Search/Page.ts +++ b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Search/Page.ts @@ -34,7 +34,9 @@ function click(event: MouseEvent): void { parameters.set(key, data[key]); }); } - } catch (e) {} + } catch (e) { + // Ignore JSON parsing failure. + } if (objectType) { parameters.set("types[]", objectType); -- 2.20.1