mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-11 02:12:21 -05:00
guard against missing editor element in editor-base-controller.save
issue #5659 - Fixes occasional issue with `Uncaught TypeError: Cannot read property 'val' of undefined` errors appearing when navigating quickly to/from the editor. I traced the `save` action calls back to the `autoSave` method - it may warrant further investigation to find out why the throttled/debounced calls are sometimes made when the editor element is non-existent.
This commit is contained in:
parent
4e4de10e19
commit
22d4151e33
1 changed files with 7 additions and 0 deletions
|
@ -248,6 +248,13 @@ export default Ember.Mixin.create({
|
|||
|
||||
options = options || {};
|
||||
|
||||
// when navigating quickly between pages autoSave will occasionally
|
||||
// try to run after the editor has been torn down so bail out here
|
||||
// before we throw errors
|
||||
if (!this.get('editor').$()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
this.toggleProperty('submitting');
|
||||
|
||||
if (options.backgroundSave) {
|
||||
|
|
Loading…
Add table
Reference in a new issue