Check if someone tries to set null as att name
authorAndre Heinecke <aheinecke@intevation.de>
Wed, 11 Jul 2018 14:45:22 +0000 (16:45 +0200)
committerAndre Heinecke <aheinecke@intevation.de>
Wed, 11 Jul 2018 14:45:22 +0000 (16:45 +0200)
* src/attachment.cpp (Attachment::set_display_name): Check for NULL.

--
Should not happen but better save then sorry

src/attachment.cpp

index 783272c..68f8025 100644 (file)
@@ -43,6 +43,12 @@ Attachment::get_display_name() const
 void
 Attachment::set_display_name(const char *name)
 {
+  if (!name)
+    {
+      log_error ("%s:%s: Display name set to null.",
+                 SRCNAME, __func__);
+      return;
+    }
   m_utf8DisplayName = std::string(name);
 }