[FIX] get_file error: the exception can be the only node and must be json parsed

bzr revid: sle@openerp.com-20140414105333-05jona7myntifamw
This commit is contained in:
Simon Lejeune
2014-04-14 12:53:33 +02:00
parent f8664c8d97
commit faadf0fec4
+5 -8
View File
@@ -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();
}