summaryrefslogtreecommitdiff
path: root/src/cpl.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2020-09-27 20:20:23 +0200
committerCarl Hetherington <cth@carlh.net>2020-09-27 20:20:23 +0200
commit018bb01d2190cb57ded144fcb3944c3312abbbba (patch)
tree2377315ed16c56d99e612d6dec8b9e6e7df26c94 /src/cpl.cc
parent627dfd9a5cdcce9e4122ef3041a38c3da2d3a120 (diff)
<ContentVersion> is optional in Interop so we can't assume it's there.
Diffstat (limited to 'src/cpl.cc')
-rw-r--r--src/cpl.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/cpl.cc b/src/cpl.cc
index ead592fd..2768e797 100644
--- a/src/cpl.cc
+++ b/src/cpl.cc
@@ -654,10 +654,13 @@ CPL::set_content_versions (vector<ContentVersion> v)
}
-ContentVersion
+optional<ContentVersion>
CPL::content_version () const
{
- DCP_ASSERT (!_content_versions.empty());
+ if (_content_versions.empty()) {
+ return optional<ContentVersion>();
+ }
+
return _content_versions[0];
}