From 055b7e7c12f14714be9f62413dba4c0a7e7b36f3 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Sun, 14 Apr 2019 09:33:47 +0200 Subject: [PATCH] Throw exception in `FormDocument::getHtml()` if form has not been built See #2509 --- .../files/lib/system/form/builder/FormDocument.class.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wcfsetup/install/files/lib/system/form/builder/FormDocument.class.php b/wcfsetup/install/files/lib/system/form/builder/FormDocument.class.php index 302b00248c..48555ada6a 100644 --- a/wcfsetup/install/files/lib/system/form/builder/FormDocument.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/FormDocument.class.php @@ -406,6 +406,10 @@ class FormDocument implements IFormDocument { * @inheritDoc */ public function getHtml() { + if (!$this->isBuilt) { + throw new \BadMethodCallException("The form document has to be built before it can be rendered."); + } + return WCF::getTPL()->fetch( '__form', 'wcf', -- 2.20.1