From 936d65531ba3308c1ff607871c5b33434bf9492f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Patrick=20M=C3=BCller?= <p.mueller@pcsg.de>
Date: Mon, 21 Dec 2020 14:01:58 +0100
Subject: [PATCH] fix: quiqqer/captcha#10

---
 bin/Controls/SimpleContact.js | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/bin/Controls/SimpleContact.js b/bin/Controls/SimpleContact.js
index 3c0dca4..dc5cfa3 100644
--- a/bin/Controls/SimpleContact.js
+++ b/bin/Controls/SimpleContact.js
@@ -62,9 +62,16 @@ define('package/quiqqer/bricks/bin/Controls/SimpleContact', [
                         if (self.$captchaRequired && !self.$captchaResponse) {
                             QUI.getMessageHandler(function (MH) {
                                 MH.options.displayTimeMessages = 2000;
+
+                                var CaptchaElm = self.$Elm.getElement('.qui-contact-captcha');
+
+                                if (!CaptchaElm) {
+                                    CaptchaElm = undefined;
+                                }
+                                
                                 MH.addError(
                                     QUILocale.get(lg, 'brick.control.simpleContact.error.captcha_failed'),
-                                    self.$Elm.getElement('.qui-contact-captcha')
+                                    CaptchaElm
                                 );
                             });
 
-- 
GitLab