From bde33508c932ebe91c0c2fdef642206730632d23 Mon Sep 17 00:00:00 2001
From: Mohcine Chraibi <m.chraibi@fz-juelich.de>
Date: Thu, 23 May 2019 12:43:39 +0200
Subject: [PATCH] check for empty vectors

related to #107
---
 methods/Method_I.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/methods/Method_I.cpp b/methods/Method_I.cpp
index ff96188f..b2a1f4a7 100644
--- a/methods/Method_I.cpp
+++ b/methods/Method_I.cpp
@@ -138,6 +138,11 @@ bool Method_I::Process(const PedData& peddata,const fs::path& scriptsLocation, c
           vector<double> YInFrame = peddata.GetYInFrame(frameNr, ids, zPos_measureArea);
           vector<double> ZInFrame = peddata.GetZInFrame(frameNr, ids, zPos_measureArea);
           vector<double> VInFrame = peddata.GetVInFrame(frameNr, ids, zPos_measureArea);
+          if(XInFrame.size() == 0)
+          {
+               Log->Write("Warning:\t no pedestrians in frame <%d>", frameNr);
+               continue;
+          }
           //vector int to_remove
           //------------------------------Remove peds outside geometry------------------------------------------
           for( int i=0;i<(int)IdInFrame.size();i++)
-- 
GitLab