[FIX] web: prevent crash in line chart with 1 record
Since commit 8625242884, the graph view crashed when
displaying a line chart with only one record. The reason is that the
method display_line can return undefined (if no line chart can be
displayed). In that case, there is no reasy to try to display its
tooltip.
This commit simply protect against the case where it is undefined.
This commit is contained in:
@@ -99,7 +99,9 @@ return Widget.extend({
|
||||
}));
|
||||
} else {
|
||||
var chart = this['display_' + this.mode]();
|
||||
chart.tooltip.chartContainer(this.$el[0]);
|
||||
if (chart) {
|
||||
chart.tooltip.chartContainer(this.$el[0]);
|
||||
}
|
||||
}
|
||||
},
|
||||
display_bar: function () {
|
||||
|
||||
Reference in New Issue
Block a user