summaryrefslogtreecommitdiffstats
path: root/ml
diff options
context:
space:
mode:
Diffstat (limited to 'ml')
-rw-r--r--ml/ml.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/ml/ml.cc b/ml/ml.cc
index 44e200a236..b56401b07a 100644
--- a/ml/ml.cc
+++ b/ml/ml.cc
@@ -90,7 +90,10 @@ void ml_delete_dimension(RRDDIM *RD) {
return;
Host *H = static_cast<Host *>(RD->rrdset->rrdhost->ml_host);
- H->removeDimension(D);
+ if (!H)
+ delete D;
+ else
+ H->removeDimension(D);
RD->state->ml_dimension = nullptr;
}