From 1f38dd6c0732fe43000dd99448f17088b299f706 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Mon, 15 Apr 2019 18:56:43 +0200 Subject: [PATCH] Add missing exception in `TSelectionFormField::getOptions()` See #2509 --- .../system/form/builder/field/TSelectionFormField.class.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wcfsetup/install/files/lib/system/form/builder/field/TSelectionFormField.class.php b/wcfsetup/install/files/lib/system/form/builder/field/TSelectionFormField.class.php index 064e1ce4f5..257d15313e 100644 --- a/wcfsetup/install/files/lib/system/form/builder/field/TSelectionFormField.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/field/TSelectionFormField.class.php @@ -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; } -- 2.20.1