summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/core.js
diff options
context:
space:
mode:
authorRichard Mathot (OpenERP) <rim@openerp.com>2014-04-30 10:01:03 +0200
committerRichard Mathot (OpenERP) <rim@openerp.com>2014-04-30 10:01:03 +0200
commit03cfbf0f469ef174b6b0c26e1830d5f2e97b987c (patch)
tree51a97f3170d4e54c9a36136bac90ea7ca0fd52b7 /addons/web/static/src/js/core.js
parent775e553d5a9b7abb1218bb36b22bad03221d3049 (diff)
parentadef80714d6f3a7cb5940cdefd21280a2a67bfe5 (diff)
[MERGE] from lp:openerp-web
bzr revid: rim@openerp.com-20140430080103-tc4a9ow7rwp3b5nk
Diffstat (limited to 'addons/web/static/src/js/core.js')
-rw-r--r--addons/web/static/src/js/core.js13
1 files changed, 5 insertions, 8 deletions
diff --git a/addons/web/static/src/js/core.js b/addons/web/static/src/js/core.js
index a4bcd1922de..74866112d99 100644
--- a/addons/web/static/src/js/core.js
+++ b/addons/web/static/src/js/core.js
@@ -460,14 +460,11 @@ instance.web.Session.include( /** @lends instance.web.Session# */{
.appendTo(document.body)
.load(function () {
try {
- if (options.error) {
- if (!this.contentDocument.body.childNodes[1]) {
- options.error(this.contentDocument.body.childNodes);
- }
- else {
- options.error(JSON.parse(this.contentDocument.body.childNodes[1].textContent));
- }
- }
+ if (options.error) {
+ var body = this.contentDocument.body;
+ var node = body.childNodes[1] || body.childNodes[0];
+ options.error(JSON.parse(node.textContent));
+ }
} finally {
complete();
}