From cb338e1ce557054d9f8b25dd8f665cd660d8c067 Mon Sep 17 00:00:00 2001 From: Molkobain Date: Thu, 18 Feb 2021 15:39:40 +0100 Subject: [PATCH] Case log form entry: Protection against general form not found when in bridge mode --- js/layouts/activity-panel/caselog-entry-form.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/js/layouts/activity-panel/caselog-entry-form.js b/js/layouts/activity-panel/caselog-entry-form.js index b0d0444ab5..db5f8a11fa 100644 --- a/js/layouts/activity-panel/caselog-entry-form.js +++ b/js/layouts/activity-panel/caselog-entry-form.js @@ -111,9 +111,13 @@ $(function() { // Update the general form input on submit. // This cannot be "completely" done in the "change" handler above because we don't have an event for when // the image has been uploaded and its HTML markup added to the data. The "change" event occurs too early. - this._GetGeneralFormElement().on('submit', function () { - me._UpdateBridgeInput(); - }); + if (null === this._GetGeneralFormElement()) { + CombodoJSConsole.Error('CaseLogEntryForm: Could not find the general form element, image upload will NOT work in CKEditor'); + } else { + this._GetGeneralFormElement().on('submit', function () { + me._UpdateBridgeInput(); + }); + } } // Form buttons