Fixed outside calls throwing an error for interactive dropdowns
authorAlexander Ebert <ebert@woltlab.com>
Mon, 4 Apr 2016 10:54:21 +0000 (12:54 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Mon, 4 Apr 2016 10:54:27 +0000 (12:54 +0200)
wcfsetup/install/files/js/WCF.User.js

index aa1d4ef296450308a7b5c6764e08b66fbf387442..6e7584d2c553f44c02a1f3b58d1e5292760b89ad 100644 (file)
@@ -405,7 +405,11 @@ WCF.User.Panel.Abstract = Class.extend({
         * Resets the dropdown's inner item list.
         */
        resetItems: function() {
-               this._dropdown.resetItems();
+               // this method could be called from outside, but the dropdown was never
+               // toggled and thus never initialized
+               if (this._dropdown !== null) {
+                       this._dropdown.resetItems();
+               }
        }
 });