Skip to content

Commit

Permalink
Only error check on path existence if copyFile is true or path is abs…
Browse files Browse the repository at this point in the history
…olute.
  • Loading branch information
joseph-robertson authored and jmarrec committed Jun 30, 2023
1 parent e935dae commit bdddd1f
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/model/ExternalFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,15 +220,17 @@ namespace model {

// we expect all strings to be UTF-8 encoded
path p = toPath(filename);
if (!exists(p)) {
boost::optional<path> op = workflow.findFile(filename);
if (!op) {
this->remove();
LOG_AND_THROW("Cannot find file \"" << filename << "\" for " << this->briefDescription());
if (copyFile || !p.is_relative()) {
if (!exists(p)) {
boost::optional<path> op = workflow.findFile(filename);
if (!op) {
this->remove();
LOG_AND_THROW("Cannot find file \"" << filename << "\" for " << this->briefDescription());
}
p = op.get();
}
p = op.get();
OS_ASSERT(exists(p));
}
OS_ASSERT(exists(p));

bool ok;
if (copyFile) {
Expand Down

0 comments on commit bdddd1f

Please sign in to comment.