Commit 3ed08edc59866f07ee5fa4acb73effc796ce14ab

Authored by Ben Klein
1 parent b32f0957

Fix bug where non-existant .gal target file causes -eval to crash

Showing 1 changed file with 1 additions and 1 deletions
openbr/core/eval.cpp
@@ -305,7 +305,7 @@ float Evaluate(const Mat &simmat, const Mat &mask, const QString &csv, const QSt @@ -305,7 +305,7 @@ float Evaluate(const Mat &simmat, const Mat &mask, const QString &csv, const QSt
305 305
306 // Attempt to read template size from enrolled gallery and write to output CSV 306 // Attempt to read template size from enrolled gallery and write to output CSV
307 size_t maxSize(0); 307 size_t maxSize(0);
308 - if (target.endsWith(".gal")) { 308 + if (target.endsWith(".gal") && QFileInfo(target).exists()) {
309 foreach (const Template &t, TemplateList::fromGallery(target)) maxSize = max(maxSize, t.bytes()); 309 foreach (const Template &t, TemplateList::fromGallery(target)) maxSize = max(maxSize, t.bytes());
310 lines.append(QString("TS,,%1").arg(QString::number(maxSize))); 310 lines.append(QString("TS,,%1").arg(QString::number(maxSize)));
311 } 311 }