[gnome-software] GsApp: Don't assert that we have a bundle kind in get_packaging_format



commit b39923a710efad7a7ba6e6393ec1eb7bbdd7c84d
Author: Kalev Lember <klember redhat com>
Date:   Sat Mar 2 12:46:36 2019 +0100

    GsApp: Don't assert that we have a bundle kind in get_packaging_format
    
    This allows the caller to handle the error gracefully by not showing the
    field.

 lib/gs-app.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/lib/gs-app.c b/lib/gs-app.c
index cb5e93b2..cb1840be 100644
--- a/lib/gs-app.c
+++ b/lib/gs-app.c
@@ -4497,6 +4497,9 @@ gs_app_get_packaging_format (GsApp *app)
        /* fall back to bundle kind */
        bundle_kind = gs_app_get_bundle_kind (app);
        switch (bundle_kind) {
+       case AS_BUNDLE_KIND_UNKNOWN:
+               bundle_kind_ui = NULL;
+               break;
        case AS_BUNDLE_KIND_LIMBA:
                bundle_kind_ui = "Limba";
                break;
@@ -4520,7 +4523,6 @@ gs_app_get_packaging_format (GsApp *app)
                bundle_kind_ui = as_bundle_kind_to_string (bundle_kind);
        }
 
-       g_assert (bundle_kind_ui != NULL);
        return g_strdup (bundle_kind_ui);
 }
 


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