added error message for file index out of bounds

This commit is contained in:
Lovisa Hassler
2018-12-05 16:19:01 -05:00
parent 35ce25ffba
commit d5d4df3b54

View File

@@ -85,8 +85,11 @@ namespace openspace {
// according to the longest light travel time
int lightTimeTravelBuffer = 1;
if (index == -1 || index >= _dataFiles.size())
if (index <= -1 || index >= _dataFiles.size())
{
LERROR(fmt::format("{}: File index {} is out of bounds.", _loggerCat, index));
return;
}
signalData.signals.clear();
signalData.signals.reserve(sizeBuffer);