Skip to content

Commit fa94bb3

Browse files
committed
Prevent cfg file write exceptions.
1 parent ff16d6a commit fa94bb3

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/sw/driver/target/base.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,11 @@ String Target::getConfig() const
450450
path Target::getTargetsDir() const
451451
{
452452
auto d = getMainBuild().getBuildDirectory() / "out" / getConfig();
453-
write_file(d / "cfg.json", nlohmann::json::parse(ts.toString(TargetSettings::Json)).dump(4));
453+
try
454+
{
455+
write_file(d / "cfg.json", nlohmann::json::parse(ts.toString(TargetSettings::Json)).dump(4));
456+
}
457+
catch (...) {} // write once
454458
return d;
455459
}
456460

0 commit comments

Comments
 (0)