From c9ca1c6c7fbc8a317e7e3235e98abca0dab2299f Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Fri, 25 Jun 2021 17:04:45 +0200 Subject: [PATCH] Type hint instead of a type cast The type hint is only meant to narrow the type, not replace it. --- ts/WoltLabSuite/Core/Ui/Message/Quote.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ts/WoltLabSuite/Core/Ui/Message/Quote.ts b/ts/WoltLabSuite/Core/Ui/Message/Quote.ts index 551fd9b3f1..cf9f4a663c 100644 --- a/ts/WoltLabSuite/Core/Ui/Message/Quote.ts +++ b/ts/WoltLabSuite/Core/Ui/Message/Quote.ts @@ -483,7 +483,7 @@ export class UiMessageQuote implements AjaxCallbackObject { } // close navigation on mobile - const navigationList = listItem.closest(".buttonGroupNavigation") as HTMLUListElement | null; + const navigationList: HTMLUListElement | null = listItem.closest(".buttonGroupNavigation"); if (navigationList && navigationList.classList.contains("jsMobileButtonGroupNavigation")) { const dropDownLabel = navigationList.querySelector(".dropdownLabel") as HTMLElement; dropDownLabel.click(); -- 2.20.1