From 4af17b49c8fe38c2e9fcbc3e5a6f874d29c012da Mon Sep 17 00:00:00 2001 From: gagarinlg Date: Thu, 26 May 2022 15:37:24 +0200 Subject: [PATCH] fix nullptr access in curve edit --- radio/src/gui/colorlcd/model_curves.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/radio/src/gui/colorlcd/model_curves.cpp b/radio/src/gui/colorlcd/model_curves.cpp index f1ea93ca2..dbdf8d9ef 100644 --- a/radio/src/gui/colorlcd/model_curves.cpp +++ b/radio/src/gui/colorlcd/model_curves.cpp @@ -193,8 +193,10 @@ class CurveEditWindow : public Page } SET_DIRTY(); curveEdit->updatePreview(); - curveDataEdit->clear(); - curveDataEdit->update(); + if(curveDataEdit) { + curveDataEdit->clear(); + curveDataEdit->update(); + } } }); @@ -217,8 +219,10 @@ class CurveEditWindow : public Page curve.points = newValue; SET_DIRTY(); curveEdit->updatePreview(); - curveDataEdit->clear(); - curveDataEdit->update(); + if(curveDataEdit) { + curveDataEdit->clear(); + curveDataEdit->update(); + } } }); edit->setSuffix(STR_PTS);