1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00

Merge pull request #1653 from MarcoPolo-PasTonMolo/fix/editor-crash

Fix crash on /editor
This commit is contained in:
Michael Vetter 2022-03-24 15:37:38 +01:00 committed by GitHub
commit 39b276986b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -71,7 +71,11 @@ get_message_from_editor(gchar* message, gchar** returned_message)
return TRUE; 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)) { 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"); log_error("[Editor] could not write to %s: %s", filename, glib_error ? glib_error->message : "No GLib error given");
if (glib_error) { if (glib_error) {