[chronojump] Fixed few potential bugs on forceSensorAnalyze if no signal



commit a08f7eeb87a15dc5407765c4e5788c166d8e0636
Author: Xavier de Blas <xaviblas gmail com>
Date:   Mon Nov 9 18:49:34 2020 +0100

    Fixed few potential bugs on forceSensorAnalyze if no signal

 src/gui/app1/forceSensorAnalyze.cs | 12 ++++++++++++
 1 file changed, 12 insertions(+)
---
diff --git a/src/gui/app1/forceSensorAnalyze.cs b/src/gui/app1/forceSensorAnalyze.cs
index e6ab9096..dcd651a0 100644
--- a/src/gui/app1/forceSensorAnalyze.cs
+++ b/src/gui/app1/forceSensorAnalyze.cs
@@ -1033,6 +1033,9 @@ public partial class ChronoJumpWindow
 
        private void on_button_force_sensor_ai_zoom_clicked (object o, EventArgs args)
        {
+               if(fsAI == null || fsAI.GetLength() == 0)
+                       return;
+
                forceSensorZoomApplied = true;
 
                //store hscale a to help return to position on unzoom
@@ -1051,6 +1054,9 @@ public partial class ChronoJumpWindow
        }
        private void on_button_force_sensor_ai_zoom_out_clicked (object o, EventArgs args)
        {
+               if(fsAI == null || fsAI.GetLength() == 0)
+                       return;
+
                forceSensorZoomApplied = false;
 
                hscale_force_sensor_ai_a_AtZoom = Convert.ToInt32(hscale_force_sensor_ai_a.Value);
@@ -1551,6 +1557,9 @@ public partial class ChronoJumpWindow
        }
        private void on_button_hscale_force_sensor_ai_a_last_clicked (object o, EventArgs args)
        {
+               if(fsAI == null || fsAI.GetLength() < 2)
+                       return;
+
                hscale_force_sensor_ai_a.Value = fsAI.GetLength() -2;
        }
 
@@ -1569,6 +1578,9 @@ public partial class ChronoJumpWindow
 
        private void on_button_hscale_force_sensor_ai_b_last_clicked (object o, EventArgs args)
        {
+               if(fsAI == null || fsAI.GetLength() < 2)
+                       return;
+
                hscale_force_sensor_ai_b.Value = fsAI.GetLength() -2;
        }
 


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