[FIX] web: CrashManager can crash if trying to show an empty message

If `d.message` is an empty string, `!!d.message` is false and the
crashmanager will try to display `d.error.data.message`… which does
not exist as it's a warning with an empty message not an upstream error.

That causes the crashmanager itself to crash, and even the warning
name/title to be lost.
This commit is contained in:
xmo-odoo
2017-06-08 14:16:43 +02:00
committed by GitHub
parent 1612f2cdf7
commit 45e94ec756
+1 -1
View File
@@ -22,7 +22,7 @@
<t t-name="CrashManager.warning">
<div class="o_dialog_warning">
<t t-js="d">
var message = d.message ? d.message : d.error.data.message;
var message = (d.message !== undefined) ? d.message : d.error.data.message;
d.html_error = context.engine.tools.html_escape(message).replace(/\n/g, '<br/>');
</t>
<t t-raw="html_error"/>