diff options
| author | Carl Hetherington <cth@carlh.net> | 2020-09-23 20:15:35 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2020-09-23 20:15:35 +0200 |
| commit | 206e5213c74c848f0b6dc46f879cabe30a436e51 (patch) | |
| tree | e6deeddd7752cf7961ec3e17f25c99dec344e2bf /src | |
| parent | e40f5c5923d72b42d7b1c617a6e459569d584e8c (diff) | |
Don't fail to write CPL if no content version has been set up.
Diffstat (limited to 'src')
| -rw-r--r-- | src/cpl.cc | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -185,8 +185,12 @@ CPL::write_xml (boost::filesystem::path file, Standard standard, shared_ptr<cons root->add_child("Creator")->add_child_text (_creator); root->add_child("ContentTitleText")->add_child_text (_content_title_text); root->add_child("ContentKind")->add_child_text (content_kind_to_string (_content_kind)); - DCP_ASSERT (!_content_versions.empty()); - _content_versions[0].as_xml (root); + if (_content_versions.empty()) { + ContentVersion cv; + cv.as_xml (root); + } else { + _content_versions[0].as_xml (root); + } xmlpp::Element* rating_list = root->add_child("RatingList"); BOOST_FOREACH (Rating i, _ratings) { |
