Add missing default values of `PasswordStrength` properties
authorMatthias Schmidt <gravatronics@live.com>
Fri, 7 May 2021 07:36:29 +0000 (09:36 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Fri, 7 May 2021 07:36:29 +0000 (09:36 +0200)
ts/WoltLabSuite/Core/Ui/User/PasswordStrength.ts
wcfsetup/install/files/js/WoltLabSuite/Core/Ui/User/PasswordStrength.js

index 42bcf605e0922d8d5f8c1233bb427dea5a601fa7..44ed557771361fab6d5a5d60fdf5f9b512d7dd12 100644 (file)
@@ -50,8 +50,8 @@ function initializeFeedbacker(Feedback: typeof zxcvbn.Feedback): zxcvbn.Feedback
 
 class PasswordStrength {
   private zxcvbn: typeof zxcvbn;
-  private relatedInputs: HTMLInputElement[];
-  private staticDictionary: StaticDictionary;
+  private relatedInputs: HTMLInputElement[] = [];
+  private staticDictionary: StaticDictionary = [];
   private feedbacker: zxcvbn.Feedback;
 
   private wrapper: HTMLDivElement;
index 36aba4d40db6c0010da731c6d5bd46727d12f99a..959adb5f034b21ce269f373df53907740d72d644 100644 (file)
@@ -40,6 +40,8 @@ define(["require", "exports", "tslib", "../../Language", "../../Dom/Util"], func
     class PasswordStrength {
         constructor(input, options) {
             this.input = input;
+            this.relatedInputs = [];
+            this.staticDictionary = [];
             this.score = document.createElement("span");
             this.verdictResult = document.createElement("input");
             void new Promise((resolve_1, reject_1) => { require(["zxcvbn"], resolve_1, reject_1); }).then(tslib_1.__importStar).then(({ default: zxcvbn }) => {