sn_id = g_app_launch_context_get_startup_notify_id (launch_context,
G_APP_INFO (info),
launched_files);
- envp = g_environ_setenv (envp, "DESKTOP_STARTUP_ID", sn_id, TRUE);
+ if (sn_id)
+ {
+ envp = g_environ_setenv (envp, "DESKTOP_STARTUP_ID", sn_id, TRUE);
+ g_free (sn_id);
+ }
}
g_list_free_full (launched_files, g_object_unref);
gchar *sn_id;
sn_id = g_app_launch_context_get_startup_notify_id (launch_context, G_APP_INFO (info), launched_files);
- g_variant_builder_add (&builder, "{sv}", "desktop-startup-id", g_variant_new_take_string (sn_id));
+ if (sn_id)
+ g_variant_builder_add (&builder, "{sv}", "desktop-startup-id", g_variant_new_take_string (sn_id));
}
g_list_free_full (launched_files, g_object_unref);