about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--src/tools/editor.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/tools/editor.c b/src/tools/editor.c
index f8dc5b22..6fcc08bb 100644
--- a/src/tools/editor.c
+++ b/src/tools/editor.c
@@ -71,7 +71,11 @@ get_message_from_editor(gchar* message, gchar** returned_message)
         return TRUE;
     }
 
-    gsize messagelen = strlen(message);
+    gsize messagelen = 0;
+    if (message != NULL) {
+        messagelen = strlen(message);
+    }
+
     if (!g_file_set_contents(filename, message, messagelen, &glib_error)) {
         log_error("[Editor] could not write to %s: %s", filename, glib_error ? glib_error->message : "No GLib error given");
         if (glib_error) {