Fix crash on 'report a problem' in the KDM creator.
authorCarl Hetherington <cth@carlh.net>
Wed, 28 Sep 2016 10:15:57 +0000 (11:15 +0100)
committerCarl Hetherington <cth@carlh.net>
Wed, 28 Sep 2016 10:15:57 +0000 (11:15 +0100)
ChangeLog
src/lib/job.cc

index c4bd566d36c429cf9cb569cf87394be7c604584d..ad3447b9a9de3f00f88e7c28f38c3d68eabe7179 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2016-09-28  c.hetherington  <cth@carlh.net>
+
+       * Fix crash on "report a problem" in the KDM creator.
+
 2016-09-27  Carl Hetherington  <cth@carlh.net>
 
        * Updated ru_RU translation from Igor Voytovich.
index ed0370479a5ae1ffb8de08b07e695323b56383de..51deca4044b0a4debc300fed8dfab54ac44cd2d8 100644 (file)
@@ -45,8 +45,8 @@ using boost::shared_ptr;
 using boost::optional;
 using boost::function;
 
-#define LOG_ERROR_NC(...) _film->log()->log (__VA_ARGS__, LogEntry::TYPE_ERROR);
-#define LOG_GENERAL(...) _film->log()->log (String::compose (__VA_ARGS__), LogEntry::TYPE_GENERAL);
+#define LOG_ERROR_NC(...) if (_film) { _film->log()->log (__VA_ARGS__, LogEntry::TYPE_ERROR); }
+#define LOG_GENERAL(...) if (_film) { _film->log()->log (String::compose (__VA_ARGS__), LogEntry::TYPE_GENERAL); }
 
 /** @param film Associated film, or 0 */
 Job::Job (shared_ptr<const Film> film)