From b130f1bee62d066c1746d8443e29f79a3c5fe5cd Mon Sep 17 00:00:00 2001
From: Mohcine Chraibi <m.chraibi@fz-juelich.de>
Date: Tue, 14 May 2019 12:55:11 +0200
Subject: [PATCH] Fix SegFault when FrameElements is empty

---
 src/TimerCallback.cpp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/TimerCallback.cpp b/src/TimerCallback.cpp
index 0131848..416ed69 100644
--- a/src/TimerCallback.cpp
+++ b/src/TimerCallback.cpp
@@ -175,7 +175,12 @@ void TimerCallback::Execute(vtkObject *caller, unsigned long eventId,
 #endif
                             extern_glyphs_pedestrians_3D->Update();
                         }
-                        minFrame = frame->GetFrameElements()[0]->GetMinFrame();
+                        auto FrameElements =  frame->GetFrameElements();
+                        if(FrameElements.size())
+                             minFrame = frame->GetFrameElements()[0]->GetMinFrame();
+                        else
+                             minFrame = 0;
+
                         frameNumber += minFrame;
                         if(SystemSettings::getShowTrajectories()) {
                             const std::vector<FrameElement *> &elements=frame->GetFrameElements();
-- 
GitLab