X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fcinema.cc;h=f06db354343b3c971ce09e84bfba4ed950f08bf2;hb=a112eeb4d052b1212f94e95efd83a215213da691;hp=c8cb7b66cc935be866e8049b3a489971fd2712bc;hpb=9e4c091e6ef0f79fab10664e95240de2f14e5702;p=dcpomatic.git diff --git a/src/lib/cinema.cc b/src/lib/cinema.cc index c8cb7b66c..f06db3543 100644 --- a/src/lib/cinema.cc +++ b/src/lib/cinema.cc @@ -17,9 +17,9 @@ */ -#include -#include #include "cinema.h" +#include +#include using std::list; using boost::shared_ptr; @@ -68,16 +68,20 @@ Cinema::remove_screen (shared_ptr s) } Screen::Screen (cxml::ConstNodePtr node) + : name (node->string_child ("name")) { - name = node->string_child ("Name"); - certificate = shared_ptr (new dcp::Certificate (node->string_child ("Certificate"))); + if (node->optional_string_child ("Certificate")) { + certificate = dcp::Certificate (node->string_child ("Certificate")); + } } void Screen::as_xml (xmlpp::Element* parent) const { parent->add_child("Name")->add_child_text (name); - parent->add_child("Certificate")->add_child_text (certificate->certificate (true)); + if (certificate) { + parent->add_child("Certificate")->add_child_text (certificate->certificate (true)); + } }