silverstripe / silverstripe-asset-admin

Silverstripe assets gallery for asset management
BSD 3-Clause "New" or "Revised" License
19 stars 78 forks source link

FIX Ensure img is fetched and exists in tinymce plugin #1332

Closed GuySartorelli closed 1 year ago

GuySartorelli commented 1 year ago

Issue https://github.com/silverstripe/silverstripe-asset-admin/issues/1333

This PR avoids this scenario by:

  1. Trying to get the image from the child of the currently selected node (in debugging I found the <p> tag wrapping the image was selected when the error occurs)
  2. Not calling setAttribute() if the result is still undefined.