Skip to content

Check if element exists before updating model view #175

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 5, 2019

Conversation

joostbaptist
Copy link
Contributor

Hi,

We found a small issue with the model view update. Right now, when the contentChanged event fires, the model view is updated asynchronously. However, in come cases the update is performed after the element is destroyed, leading to the following error:

TypeError: Cannot read property 'froalaEditor' of null

(caused here: https://github.com/froala/angular-froala/blob/master/src/angular-froala.js#L172)

In our case, this error happens when the user activates code view and then presses the back button of their browser.

I implemented a simple fix by checking if the element still exists before updating.

It would be great if this gets merged. Thanks!

@theroymind
Copy link

why wouldn't this be merged, it's been causing Sentry errors for us and it's a simple fix instead of forking and adding it ourselves

@lukewaite
Copy link

@stefanneculai Any chance of getting this merged and released?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants