From: Matthias Schmidt Date: Sun, 14 Apr 2019 07:33:47 +0000 (+0200) Subject: Throw exception in `FormDocument::getHtml()` if form has not been built X-Git-Tag: 5.2.0_Alpha_1~147 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=055b7e7c12f14714be9f62413dba4c0a7e7b36f3;p=GitHub%2FWoltLab%2FWCF.git Throw exception in `FormDocument::getHtml()` if form has not been built See #2509 --- 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',