JiHong88 / suneditor

Pure javascript based WYSIWYG html editor, with no dependencies.
http://suneditor.com
MIT License
1.77k stars 316 forks source link

Cannot read properties of null (reading 'style') #1052

Open deri387 opened 2 years ago

deri387 commented 2 years ago

I get an error when i use SunEditor, for more detail please check imag

Screen Shot 2022-07-06 at 10 02 34

e

JiHong88 commented 2 years ago

Please let me know under what circumstances the error occurs.

KonstantinosAng commented 7 months ago

This is still happening in the latest version:

"suneditor": "2.45.1", "suneditor-react": "3.6.1"

It happened when pasting an image from a screenshot, inside the editor.

sailing commented 7 months ago

We ran into this as well, it appeared when we had a tag like so in an email reply (munged by the user's email client): <img alt=\"image0.png\">

We think it's possible when that image tag fails to load because of the missing source, Suneditor should do a nil check or something before attempting to set attrs on it.

mondjunge commented 2 months ago

Please let me know under what circumstances the error occurs.

This is still reproduceable in the current version (2.47.0),

Cheers.

mondjunge commented 2 months ago

Actually this is a real showstopper, since the error occures while the editor is initialized, thus no eventhandlers are added afterwards, what results in changes cannot be handled and saved. It's a deadlock situation in our application.

Please fix this bug or at least catch the exception, that at least the editor instance is returned for futher processing.

Cheers.