From bd35069df7afb29283fc529c9af8134fd2821c2e Mon Sep 17 00:00:00 2001 From: Charles Otto Date: Wed, 4 Feb 2015 15:52:21 -0800 Subject: [PATCH] Make sure a file exists before trying to open it with a load/store --- openbr/openbr_plugin.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/openbr/openbr_plugin.cpp b/openbr/openbr_plugin.cpp index 15d6cdd..3e940d0 100644 --- a/openbr/openbr_plugin.cpp +++ b/openbr/openbr_plugin.cpp @@ -1479,7 +1479,9 @@ Transform *Transform::make(QString str, QObject *parent) return make(str.mid(1, str.size()-2), parent); // Base name not found? Try constructing it via LoadStore - if (!Factory::names().contains(parsed.suffix())) { + if (!Factory::names().contains(parsed.suffix()) + && (QFileInfo(parsed.suffix()).exists() + || QFileInfo(Globals->sdkPath + "/share/openbr/models/transforms/"+parsed.suffix()).exists())) { Transform *tform = make("<"+parsed.suffix()+">", parent); applyAdditionalProperties(parsed, tform); return tform; -- libgit2 0.21.4