[chronojump] Fixed an eventual crash on g.LineWidth at encoderSignal graph when there's no graph



commit 3b6256bc03ebeeb071801417e7118706a331ac41
Author: Xavier de Blas <xaviblas gmail com>
Date:   Thu Mar 31 09:40:19 2022 +0200

    Fixed an eventual crash on g.LineWidth at encoderSignal graph when there's no graph

 src/gui/cairo/encoder.cs | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/src/gui/cairo/encoder.cs b/src/gui/cairo/encoder.cs
index a804b1ecd..e5e027042 100644
--- a/src/gui/cairo/encoder.cs
+++ b/src/gui/cairo/encoder.cs
@@ -99,6 +99,10 @@ public class CairoGraphEncoderSignal : CairoXY
                                (isInertial && (points_list_inertial == null || points_list_inertial.Count == 
0)) )
                        return true;
 
+               //fix an eventual crash on g.LineWidth below
+               if(g == null)
+                       return false;
+
                g.LineWidth = 1;
                pointsRadius = 1;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]