From ae0cf199235d1b58b01d802d6b70b52c04fb7daf Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Mon, 20 Feb 2023 14:02:08 +0000 Subject: [PATCH] Nullptr safety. --- common/widgets/mathplot.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/common/widgets/mathplot.cpp b/common/widgets/mathplot.cpp index 65ff32626e..e8968fb261 100644 --- a/common/widgets/mathplot.cpp +++ b/common/widgets/mathplot.cpp @@ -3579,23 +3579,23 @@ void mpFXY::UpdateScales() double mpFXY::s2x( double plotCoordX ) const { - return m_scaleX->TransformFromPlot( plotCoordX ); + return m_scaleX ? m_scaleX->TransformFromPlot( plotCoordX ) : plotCoordX; } double mpFXY::s2y( double plotCoordY ) const { - return m_scaleY->TransformFromPlot( plotCoordY ); + return m_scaleY ? m_scaleY->TransformFromPlot( plotCoordY ) : plotCoordY; } double mpFXY::x2s( double x ) const { - return m_scaleX->TransformToPlot( x ); + return m_scaleX ? m_scaleX->TransformToPlot( x ) : x; } double mpFXY::y2s( double y ) const { - return m_scaleY->TransformToPlot( y ); + return m_scaleY ? m_scaleY->TransformToPlot( y ) : y; }