diff options
| author | Carl Hetherington <cth@carlh.net> | 2020-09-27 20:20:23 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2020-09-27 20:20:23 +0200 |
| commit | 018bb01d2190cb57ded144fcb3944c3312abbbba (patch) | |
| tree | 2377315ed16c56d99e612d6dec8b9e6e7df26c94 /src | |
| parent | 627dfd9a5cdcce9e4122ef3041a38c3da2d3a120 (diff) | |
<ContentVersion> is optional in Interop so we can't assume it's there.
Diffstat (limited to 'src')
| -rw-r--r-- | src/cpl.cc | 7 | ||||
| -rw-r--r-- | src/cpl.h | 2 |
2 files changed, 6 insertions, 3 deletions
@@ -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]; } @@ -140,7 +140,7 @@ public: return _content_kind; } - ContentVersion content_version () const; + boost::optional<ContentVersion> content_version () const; std::vector<ContentVersion> content_versions () const { return _content_versions; |
