[chronojump] Fix hang if export sprint where all data has just two tracks



commit a8505f3253d696e8065650f0965109989688ebf4
Author: Xavier de Blas <xaviblas gmail com>
Date:   Thu Jun 10 17:46:29 2021 +0200

    Fix hang if export sprint where all data has just two tracks

 src/exportFiles/sprint.cs | 27 +++++++++++++++------------
 1 file changed, 15 insertions(+), 12 deletions(-)
---
diff --git a/src/exportFiles/sprint.cs b/src/exportFiles/sprint.cs
index 0321c3568..58468cac0 100644
--- a/src/exportFiles/sprint.cs
+++ b/src/exportFiles/sprint.cs
@@ -149,21 +149,24 @@ public class SprintExport : ExportFiles
 
                Util.FileDelete(RunInterval.GetCSVResultsFileName());
 
+               //no data, maybe because all the tests have just two tracks and cannot be processed as sprint
+               if(sprge_l.Count == 0)
+               {
+                       noData = true;
+                       return false;
+               }
+
                // call the graph
+               SprintRGraph s = new SprintRGraph (
+                               sprge_l,
+                               exportDecimalSeparator,
+                               includeImages
+                               );
 
-               if(sprge_l.Count > 0)
+               if(! s.CallR(imageWidth, imageHeight, false))
                {
-                       SprintRGraph s = new SprintRGraph (
-                                       sprge_l,
-                                       exportDecimalSeparator,
-                                       includeImages
-                                       );
-
-                       if(! s.CallR(imageWidth, imageHeight, false))
-                       {
-                               failedRprocess = true;
-                               return false;
-                       }
+                       failedRprocess = true;
+                       return false;
                }
 
                LogB.Information("Waiting creation of file... ");


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