From ceb8796590bcdf01cde2d1f89c03116fee08be6a Mon Sep 17 00:00:00 2001 From: Bartek Fabiszewski Date: Sun, 22 Dec 2019 14:57:25 +0100 Subject: [PATCH] Fix null reference --- js/src/chartviewmodel.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/src/chartviewmodel.js b/js/src/chartviewmodel.js index f84c549..289a40b 100644 --- a/js/src/chartviewmodel.js +++ b/js/src/chartviewmodel.js @@ -176,7 +176,9 @@ export default class ChartViewModel extends ViewModel { * @param {string} $className */ pointsRemoveClass($className) { - this.chartPoints.forEach((el) => el.classList.remove($className)); + if (this.model.chartVisible && this.chartPoints) { + this.chartPoints.forEach((el) => el.classList.remove($className)); + } } /**