system: guard destroy on traffic widget

PR: https://forum.opnsense.org/index.php?topic=41729.msg205775#msg205775
This commit is contained in:
Franco Fichtner 2024-07-31 09:52:18 +02:00
parent f827497f15
commit 4501c593ec

View File

@ -240,7 +240,11 @@ export default class Traffic extends BaseWidget {
onWidgetClose() {
super.onWidgetClose();
this.charts.trafficIn.destroy();
this.charts.trafficOut.destroy();
if (this.charts.trafficIn !== null) {
this.charts.trafficIn.destroy();
}
if (this.charts.trafficOut !== null) {
this.charts.trafficOut.destroy();
}
}
}