Add missing exception in `TSelectionFormField::getOptions()`
authorMatthias Schmidt <gravatronics@live.com>
Mon, 15 Apr 2019 16:56:43 +0000 (18:56 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Mon, 15 Apr 2019 16:56:43 +0000 (18:56 +0200)
See #2509

wcfsetup/install/files/lib/system/form/builder/field/TSelectionFormField.class.php

index 064e1ce4f554904f21bf8f0a6045b70b801b7f8c..257d15313ec631472b0860d571af0b80e23b3ffc 100644 (file)
@@ -51,6 +51,10 @@ trait TSelectionFormField {
         * @throws      \BadMethodCallException         if no options have been set
         */
        public function getOptions() {
+               if ($this->options === null) {
+                       throw new \BadMethodCallException("No options have been set.");
+               }
+               
                return $this->options;
        }