From 4bc43e6ac28e783885db04d634d2bf3cca2048fc Mon Sep 17 00:00:00 2001 From: Antony Lesuisse Date: Sun, 29 Jun 2014 03:48:32 +0200 Subject: [PATCH] [FIX] website snippet editor initialisation --- addons/website/static/src/js/website.snippets.editor.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/website/static/src/js/website.snippets.editor.js b/addons/website/static/src/js/website.snippets.editor.js index 64854442af7..61a60b2b0c5 100644 --- a/addons/website/static/src/js/website.snippets.editor.js +++ b/addons/website/static/src/js/website.snippets.editor.js @@ -1565,7 +1565,9 @@ */ _readXMLData: function() { var self = this; - this.$el = this.BuildingBlock.$snippets.filter(function () { return $(this).data("snippet-id") == self.snippet_id; }).clone(); + if(this && this.BuildingBlock && this.BuildingBlock.$snippets) { + this.$el = this.BuildingBlock.$snippets.filter(function () { return $(this).data("snippet-id") == self.snippet_id; }).clone(); + } var $options = this.$overlay.find(".oe_overlay_options"); if ($options.find(".oe_options ul li").length) { $options.find(".oe_options").removeClass("hidden");