[gnome-software] update dialog: Be more defensive when matching app to a section



commit 93a0b26428bcd7e881240683410ad53de63f9cd7
Author: Kalev Lember <klember redhat com>
Date:   Wed Mar 21 14:06:29 2018 +0100

    update dialog: Be more defensive when matching app to a section
    
    Avoid an assert and print a warning instead, falling back to putting the
    app in the "updates" section if it's in an unhandled state.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1558928

 src/gs-update-dialog.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/src/gs-update-dialog.c b/src/gs-update-dialog.c
index fba5194b..2509831f 100644
--- a/src/gs-update-dialog.c
+++ b/src/gs-update-dialog.c
@@ -410,7 +410,10 @@ get_app_section (GsApp *app)
                        section = GS_UPDATE_DIALOG_SECTION_UPDATES;
                break;
        default:
-               g_assert_not_reached ();
+               g_warning ("get_app_section: unhandled state %s for %s",
+                          as_app_state_to_string (gs_app_get_state (app)),
+                          gs_app_get_unique_id (app));
+               section = GS_UPDATE_DIALOG_SECTION_UPDATES;
                break;
        }
 


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