From 06197449ff493bcd2ec6e51eda9f71bb034bd032 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Tue, 3 Jan 2023 23:10:20 +0100 Subject: [PATCH] [linux] fix getTitle() crash when null --- linux/window_manager_plugin.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/linux/window_manager_plugin.cc b/linux/window_manager_plugin.cc index f18d8f0a..b801cb23 100644 --- a/linux/window_manager_plugin.cc +++ b/linux/window_manager_plugin.cc @@ -392,7 +392,8 @@ static FlMethodResponse* set_always_on_bottom(WindowManagerPlugin* self, static FlMethodResponse* get_title(WindowManagerPlugin* self) { const gchar* title = gtk_window_get_title(get_window(self)); - g_autoptr(FlValue) result = fl_value_new_string(title); + g_autoptr(FlValue) result = + fl_value_new_string(title != nullptr ? title : ""); return FL_METHOD_RESPONSE(fl_method_success_response_new(result)); }