[gnome-software/wip/temp/ubuntu-xenial-rebased-corrected: 156/331] trivial: Add g_return_if_fail to gs_app_add|has_quirk. Fix check for gs_app_set_license



commit 31fad7c07ebfacb5373f662ca1f791c019e2d843
Author: Robert Ancell <robert ancell canonical com>
Date:   Wed Mar 16 16:41:30 2016 +1300

    trivial: Add g_return_if_fail to gs_app_add|has_quirk. Fix check for gs_app_set_license

 src/gs-app.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/gs-app.c b/src/gs-app.c
index 7006396..a1d2e5e 100644
--- a/src/gs-app.c
+++ b/src/gs-app.c
@@ -1367,13 +1367,13 @@ gs_app_set_license (GsApp *app, GsAppQuality quality, const gchar *license)
        guint i;
        g_auto(GStrv) tokens = NULL;
 
+       g_return_if_fail (GS_IS_APP (app));
+
        /* only save this if the data is sufficiently high quality */
        if (quality <= app->license_quality)
                return;
        app->license_quality = quality;
 
-       g_return_if_fail (GS_IS_APP (app));
-
        /* assume free software until we find an unmatched SPDX token */
        app->license_is_free = TRUE;
 
@@ -2112,6 +2112,8 @@ gs_app_set_to_be_installed (GsApp *app, gboolean to_be_installed)
 gboolean
 gs_app_has_quirk (GsApp *app, AsAppQuirk quirk)
 {
+       g_return_val_if_fail (GS_IS_APP (app), FALSE);
+
        return (app->quirk & quirk) > 0;
 }
 
@@ -2121,6 +2123,8 @@ gs_app_has_quirk (GsApp *app, AsAppQuirk quirk)
 void
 gs_app_add_quirk (GsApp *app, AsAppQuirk quirk)
 {
+       g_return_if_fail (GS_IS_APP (app));
+
        app->quirk |= quirk;
 }
 


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