[xdg-desktop-portal-gnome] screencastwidget: Protect against uninstalled apps



commit f323c6b149381a09ef39c7ba343ac9550f3629c6
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Fri Aug 13 16:11:19 2021 -0300

    screencastwidget: Protect against uninstalled apps
    
    Uninstalled apps (e.g. ones running from Builder) provide no desktop file,
    which triggers a warning in the screencast widget code.

 src/screencastwidget.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/src/screencastwidget.c b/src/screencastwidget.c
index a9265b1..cdd57dc 100644
--- a/src/screencastwidget.c
+++ b/src/screencastwidget.c
@@ -487,7 +487,10 @@ screen_cast_widget_set_app_id (ScreenCastWidget *widget,
 
       id = g_strconcat (app_id, ".desktop", NULL);
       info = G_APP_INFO (g_desktop_app_info_new (id));
-      display_name = g_app_info_get_display_name (info);
+      if (info)
+        display_name = g_app_info_get_display_name (info);
+      else
+        display_name = g_strdup (app_id);
       monitor_heading = g_strdup_printf (_("Select monitor to share with %s"),
                                          display_name);
       window_heading = g_strdup_printf (_("Select window to share with %s"),


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]