summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2024-12-04 23:11:17 +0100
committerCarl Hetherington <cth@carlh.net>2024-12-04 23:11:17 +0100
commit655a1133beca1160951cbc09bfaeb44752b9de41 (patch)
tree123dac19ade4139321b169dc1dc24837097697a2
parent29dd4c4d2f40527f2b7e2f4d819274f1a39204c7 (diff)
Don't give an alarming error when there is no assets.xml.
-rw-r--r--src/lib/film.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/lib/film.cc b/src/lib/film.cc
index a4734d4c3..1258cdb11 100644
--- a/src/lib/film.cc
+++ b/src/lib/film.cc
@@ -2439,18 +2439,24 @@ Film::read_ui_state()
vector<RememberedAsset>
Film::read_remembered_assets() const
{
+ auto const filename = dcp::filesystem::fix_long_path(file(assets_file));
+
+ if (!boost::filesystem::exists(filename)) {
+ return {};
+ }
+
vector<RememberedAsset> assets;
try {
cxml::Document xml("Assets");
- xml.read_file(dcp::filesystem::fix_long_path(file(assets_file)));
+ xml.read_file(filename);
for (auto node: xml.node_children("Asset")) {
assets.push_back(RememberedAsset(node));
}
} catch (std::exception& e) {
- LOG_ERROR("Could not read assets file %1 (%2)", file(assets_file), e.what());
+ LOG_ERROR("Could not read assets file %1 (%2)", filename, e.what());
} catch (...) {
- LOG_ERROR("Could not read assets file %1", file(assets_file));
+ LOG_ERROR("Could not read assets file %1", filename);
}
return assets;