Commit ad4cc232 authored by remi cresson's avatar remi cresson
Browse files

ENH: throw exception when the date file has less than 2 dates

parent 7ddafdff
......@@ -93,7 +93,7 @@ typedef std::vector<SingleDate> DatesType;
* Input string must be in the form of "YYYYMMDD ....."
*/
DatesType GetDatesFromStringVector(std::vector<std::string> & list, bool check_order = true){
std::cout << "GetDatesFromStringVector" << std::endl;
DatesType dates;
for (unsigned int i = 0 ; i < list.size() ; i++)
{
......@@ -119,6 +119,12 @@ DatesType GetDatesFromStringVector(std::vector<std::string> & list, bool check_o
}
}
// we need at least 2 dates !
if (dates.size()<2)
{
itkGenericExceptionMacro("Must be at least 2 dates to work");
}
// Check dates ordering
if (check_order)
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment