[chronojump] Fixed null person trying to count reps on analyze on compujump autologout



commit 02be25b87a6972682ab1133d774469a84cda594d
Author: Xavier de Blas <xaviblas gmail com>
Date:   Fri Mar 2 12:20:21 2018 +0100

    Fixed null person trying to count reps on analyze on compujump autologout

 src/gui/chronojump.cs |    3 ++-
 src/gui/encoder.cs    |    9 +++++++--
 2 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/src/gui/chronojump.cs b/src/gui/chronojump.cs
index d0890cd..245d53b 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -7109,7 +7109,8 @@ LogB.Debug("X");
                button_execute_test.Sensitive = false;
                
                encoderButtonsSensitive(encoderSensEnum.NOPERSON);
-               personChanged();
+               //don't cal personChanged because it will make changes on analyze repetitions and 
currentPerson == null
+               //personChanged();
                
                notebook_execute.Sensitive = false;
                notebook_analyze.Sensitive = false;
diff --git a/src/gui/encoder.cs b/src/gui/encoder.cs
index baf8efc..4f460b9 100644
--- a/src/gui/encoder.cs
+++ b/src/gui/encoder.cs
@@ -1439,6 +1439,9 @@ public partial class ChronoJumpWindow
        //not called on current_set
        void prepareAnalyzeRepetitions () 
        {
+               if(currentPerson == null)
+                       return;
+
                if(radio_encoder_analyze_individual_current_session.Active) 
                {
                        if(encSelReps == null || encSelReps.Type != 
EncoderSelectRepetitions.Types.INDIVIDUAL_CURRENT_SESSION)
@@ -4392,8 +4395,10 @@ public partial class ChronoJumpWindow
        {
                if(radio_encoder_analyze_individual_current_set.Active)
                        updateComboEncoderAnalyzeCurveNumFromCurrentSet ();
-               else
-                       prepareAnalyzeRepetitions();
+               else {
+                       if(currentPerson != null)
+                               prepareAnalyzeRepetitions();
+               }
        
                //blank the encoderCaptureListStore
                encoderCaptureListStore = new Gtk.ListStore (typeof (EncoderCurve));


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