From ce152a82b45581a19c867434d2feb7b176211c4c Mon Sep 17 00:00:00 2001 From: MarcoPolo-PasTonMolo Date: Thu, 24 Mar 2022 11:42:49 +0200 Subject: [PATCH] Fix crash on /editor --- src/tools/editor.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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) {