Issue Task Resolved

#111092Guard nullable values in TypeScript

Benjamin Kott 10/15/26, 20:52 updated 11/18/26, 17:35

Description

Across core and several extensions, the JavaScript reads values that can be missing at runtime without a check: elements returned by querySelector(), closest() and getElementById(), and dataset attributes. A missing element then throws a TypeError, and a missing attribute ends up as the string undefined or as NaN. Properties that are initialised with null do not declare it in their type.

These places should get a guard or a fallback where the value can really be missing, and a non-null assertion where the module’s own markup guarantees it. Properties should declare null where it is assigned

Reviews 2

History 211

  1. Benjamin Kott commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2026-11-18T17:35:15+00:00" > 11/18/26, 17:35 </span>

    Applied in changeset commit:706db87a1279ee423dc2b7549314265edac4e198.