Commit b5ec4f1d authored by effulgentsia's avatar effulgentsia

Issue #2897938 by tedbow, drpal: Prevent accessing null elements when...

Issue #2897938 by tedbow, drpal: Prevent accessing null elements when operating on ajax instances using the off_canvas renderer
parent 8972a66f
......@@ -216,7 +216,7 @@
Drupal.ajax.instances
// If there is an element and the renderer is 'off_canvas' then we want
// to add our changes.
.filter(instance => $(instance.element).attr('data-dialog-renderer') === 'off_canvas')
.filter(instance => instance && $(instance.element).attr('data-dialog-renderer') === 'off_canvas')
// Loop through all Ajax instances that use the 'off_canvas' renderer to
// set active editable ID.
.forEach((instance) => {
......
......@@ -124,7 +124,7 @@
$(toggleEditSelector).once('outsidein').on('click.outsidein', toggleEditMode);
Drupal.ajax.instances.filter(function (instance) {
return $(instance.element).attr('data-dialog-renderer') === 'off_canvas';
return instance && $(instance.element).attr('data-dialog-renderer') === 'off_canvas';
}).forEach(function (instance) {
if (!('dialogOptions' in instance.options.data)) {
instance.options.data.dialogOptions = {};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment