summaryrefslogtreecommitdiff
path: root/src/lib/text_subtitle_content.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-05-10 13:26:55 +0100
committerCarl Hetherington <cth@carlh.net>2016-05-18 11:50:29 +0100
commit90becb40eb48467b6d31d6939bcfcf39c3c9652c (patch)
treeae36f3eb019334ba214160eec52e81ab4c65f014 /src/lib/text_subtitle_content.cc
parentcc76b517f6a74f813ae38137bdc88ff3bafa6dd9 (diff)
Some allowances for video/audio/subtitle possibly being null.
Diffstat (limited to 'src/lib/text_subtitle_content.cc')
-rw-r--r--src/lib/text_subtitle_content.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/text_subtitle_content.cc b/src/lib/text_subtitle_content.cc
index 74e785ff7..4fdd690c3 100644
--- a/src/lib/text_subtitle_content.cc
+++ b/src/lib/text_subtitle_content.cc
@@ -79,7 +79,11 @@ TextSubtitleContent::as_xml (xmlpp::Node* node) const
{
node->add_child("Type")->add_child_text ("TextSubtitle");
Content::as_xml (node);
- subtitle->as_xml (node);
+
+ if (subtitle) {
+ subtitle->as_xml (node);
+ }
+
node->add_child("Length")->add_child_text (raw_convert<string> (_length.get ()));
}