From: Alexander Ebert Date: Fri, 25 Jun 2021 15:04:45 +0000 (+0200) Subject: Type hint instead of a type cast X-Git-Tag: 5.4.0_RC_1~14 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c9ca1c6c7fbc8a317e7e3235e98abca0dab2299f;p=GitHub%2FWoltLab%2FWCF.git Type hint instead of a type cast The type hint is only meant to narrow the type, not replace it. --- 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();