Commit 30efadeb authored by Rémi Duraffort's avatar Rémi Duraffort Committed by Neil Williams

LAVA-1274 fix javascript exception

When a debug message is not a string nor an object (like a boolean) the
javascript code, removed by this commit, will crash.

The corresponding code was added to work around a bug in the log format that
has been fixed 6 months ago.

Change-Id: I4908d53aa1172b780b1e6a277a8ec07517b13769
parent b286b6bd
......@@ -299,12 +299,8 @@
<div id="sectionlogs">
{% for line in log_data %}
{% if line.lvl == "debug" %}
{% if "sending" in line.msg.keys %}{% comment %}TODO: Should be removed in 2017.9{% endcomment %}
<code class="keyboard" id="L{{ forloop.counter0 }}" title="{{ line.dt }}"><kbd>{{ line.msg.sending }}</kbd></code>
{% else %}
{% get_action_id line.msg as act_id %}
<code class="debug" title="{{ line.dt }}" id="{% if act_id %}action_{{ act_id }}{% else %}L{{ forloop.counter0 }}{% endif %}">{{ line.msg|udecode }}</code>
{% endif %}
{% elif line.lvl == "input" %}
<code class="keyboard" id="L{{ forloop.counter0 }}" title="{{ line.dt }}"><kbd>{{ line.msg|udecode }}</kbd></code>
{% elif line.lvl == "target" %}
......@@ -764,13 +760,6 @@
var node;
if(level == 'debug') {
// TODO: Should be removed in 2017.9
if(typeof(d['msg']) != 'string' && 'sending' in d['msg']) {
$('<code class="keyboard" id="' + id + '"></code>')
.append($('<kbd></kbd>')
.text(d['msg']['sending']))
.insertBefore(progressNode);
} else {
var action_id = action_id_regexp.exec(d['msg']);
if(action_id) {
id = 'action_' + action_id[1].replace(/\./g, '-');
......@@ -778,7 +767,6 @@
$('<code class="debug" id="' + id + '"></code>')
.text(d['msg'])
.insertBefore(progressNode);
}
} else if(level == 'input') {
$('<code class="keyboard" id="' + id + '"></code>')
.append($('<kbd></kbd>')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment