From: Carl Hetherington Date: Tue, 6 Oct 2015 11:37:21 +0000 (+0100) Subject: Allow _film to be 0. X-Git-Tag: v2.4.6~52 X-Git-Url: https://main.carlh.net/gitweb/?p=dcpomatic.git;a=commitdiff_plain;h=1d4a1048c3fb6c19ba80efe7fa326e3e6685ec20 Allow _film to be 0. --- diff --git a/src/lib/send_problem_report_job.cc b/src/lib/send_problem_report_job.cc index b81b0439b..d0532a047 100644 --- a/src/lib/send_problem_report_job.cc +++ b/src/lib/send_problem_report_job.cc @@ -32,6 +32,7 @@ using std::string; using std::list; using boost::shared_ptr; +/** @param film Film thta the problem is with, or 0 */ SendProblemReportJob::SendProblemReportJob ( shared_ptr film, string from, @@ -47,6 +48,10 @@ SendProblemReportJob::SendProblemReportJob ( string SendProblemReportJob::name () const { + if (!_film) { + return _("Email problem report"); + } + return String::compose (_("Email problem report for %1"), _film->name()); } @@ -70,13 +75,15 @@ SendProblemReportJob::run () body += "Version: " + string (dcpomatic_version) + " " + string (dcpomatic_git_commit) + "\n\n"; - body += "log head and tail:\n"; - body += "---<8----\n"; - body += _film->log()->head_and_tail (4096); - body += "---<8----\n\n"; + if (_film) { + body += "log head and tail:\n"; + body += "---<8----\n"; + body += _film->log()->head_and_tail (4096); + body += "---<8----\n\n"; - add_file (body, "ffprobe.log"); - add_file (body, "metadata.xml"); + add_file (body, "ffprobe.log"); + add_file (body, "metadata.xml"); + } quickmail_set_body (mail, body.c_str());