diff --git a/openbr/plugins/core/loadstore.cpp b/openbr/plugins/core/loadstore.cpp index 6e4d55f..0435e2b 100644 --- a/openbr/plugins/core/loadstore.cpp +++ b/openbr/plugins/core/loadstore.cpp @@ -201,11 +201,12 @@ private: QString getFileName() const { - foreach (const QString &file, QStringList() << fileName - << Globals->sdkPath + "/share/openbr/models/distances/" + fileName - << Globals->sdkPath + "/../share/openbr/models/distances/" + fileName) - if (QFileInfo(file).exists()) - return file; + if (!fileName.isEmpty()) + foreach (const QString &file, QStringList() << fileName + << Globals->sdkPath + "/share/openbr/models/distances/" + fileName + << Globals->sdkPath + "/../share/openbr/models/distances/" + fileName) + if (QFileInfo(file).exists()) + return file; return QString(); }