diff options
Diffstat (limited to 'addons/web/static/src/js/chrome/view_manager.js')
| -rw-r--r-- | addons/web/static/src/js/chrome/view_manager.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/addons/web/static/src/js/chrome/view_manager.js b/addons/web/static/src/js/chrome/view_manager.js index 02250d5cc15..d8f0e3776d9 100644 --- a/addons/web/static/src/js/chrome/view_manager.js +++ b/addons/web/static/src/js/chrome/view_manager.js @@ -59,7 +59,8 @@ var ViewManager = Widget.extend(ControlPanelMixin, { */ on_detach_callback: function() { this.is_in_DOM = false; - if (this.active_view && this.active_view.controller.on_detach_callback) { + var controller = this.active_view && this.active_view.controller; + if (controller && controller.on_detach_callback) { this.active_view.controller.on_detach_callback(); } }, @@ -282,7 +283,7 @@ var ViewManager = Widget.extend(ControlPanelMixin, { view.$fragment = view.$fragment.contents(); view.loaded.resolve(); }); - }); + }).fail(view.loaded.reject.bind(view.loaded)); } else { view.loaded = view.loaded.then(function() { view_options = _.extend({}, view_options, self.env); |
