Commit 3ed08edc59866f07ee5fa4acb73effc796ce14ab
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 | 305 | |
| 306 | 306 | // Attempt to read template size from enrolled gallery and write to output CSV |
| 307 | 307 | size_t maxSize(0); |
| 308 | - if (target.endsWith(".gal")) { | |
| 308 | + if (target.endsWith(".gal") && QFileInfo(target).exists()) { | |
| 309 | 309 | foreach (const Template &t, TemplateList::fromGallery(target)) maxSize = max(maxSize, t.bytes()); |
| 310 | 310 | lines.append(QString("TS,,%1").arg(QString::number(maxSize))); |
| 311 | 311 | } | ... | ... |