]> git.proxmox.com Git - pve-manager.git/commitdiff
ui: running chart: avoid breakage if tooltip was on deleted record
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 22 Jul 2020 08:29:05 +0000 (10:29 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 22 Jul 2020 08:29:06 +0000 (10:29 +0200)
if we cleanup records and there was a "stale" tooltip on one of them
we get an access on undefined value exception here

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
www/manager6/panel/RunningChart.js

index 56c84eabe9543a97cfa78a29a736127ae193cc41..77d979ba45c52cb5342ba60fd6f0c9fd718f18ae 100644 (file)
@@ -62,9 +62,10 @@ Ext.define('PVE.widget.RunningChart', {
                tooltip: {
                    trackMouse: true,
                    renderer: function( tooltip, record, ctx) {
-                       var me = this.getChart();
-                       var date = new Date(record.data.time);
-                       var value = me.up().renderer(record.data.val);
+                       let me = this.getChart();
+                       if (!record || !record.data) return;
+                       let date = new Date(record.data.time);
+                       let value = me.up().renderer(record.data.val);
                        tooltip.setHtml(
                            me.up().title + ': ' + value + '<br />' +
                            Ext.Date.format(date, 'H:i:s')