Desktop: Fix crash when closing a secondary window with the Rich Text Editor open #11737
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This pull request fixes a "Joplin encountered a fatal error and could not continue" screen caused by calling
.remove()
on a TinyMCE editor after its parent window has been closed. With this change,.remove
is not called on an editor with no parent window.Note
The issue does not seem to be present in Joplin v3.2. The issue doesn't seem related to the Electron or TinyMCE upgrades — it's still present after downgrading to TinyMCE v5 and Electron v32. Edit: Based on a
git bisect
, the does seem related to the commit that upgraded from TinyMCE v5 to v6. I suspect that the issue is related to one of the changes made to the editor setup to prepare for TinyMCE v6.Error message
Testing plan