[gnome-software] trivial: Do not allow id-less GsApp's as related or history items
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] trivial: Do not allow id-less GsApp's as related or history items
- Date: Tue, 12 Sep 2017 15:55:14 +0000 (UTC)
commit 3e959a3583aacc2cce2f11c7f2dd136ef9fe9074
Author: Richard Hughes <richard hughsie com>
Date: Tue Sep 12 16:50:58 2017 +0100
trivial: Do not allow id-less GsApp's as related or history items
lib/gs-app.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/lib/gs-app.c b/lib/gs-app.c
index 5ae25fa..3fbdac0 100644
--- a/lib/gs-app.c
+++ b/lib/gs-app.c
@@ -3098,6 +3098,8 @@ gs_app_add_related (GsApp *app, GsApp *app2)
g_autoptr(GMutexLocker) locker = g_mutex_locker_new (&priv->mutex);
g_return_if_fail (GS_IS_APP (app));
+ g_return_if_fail (GS_IS_APP (app2));
+ g_return_if_fail (gs_app_get_id (app2) != NULL);
/* if the app is updatable-live and any related app is not then
* degrade to the offline state */
@@ -3152,6 +3154,8 @@ gs_app_add_history (GsApp *app, GsApp *app2)
GsAppPrivate *priv = gs_app_get_instance_private (app);
g_autoptr(GMutexLocker) locker = g_mutex_locker_new (&priv->mutex);
g_return_if_fail (GS_IS_APP (app));
+ g_return_if_fail (GS_IS_APP (app2));
+ g_return_if_fail (gs_app_get_id (app2) != NULL);
g_ptr_array_add (priv->history, g_object_ref (app2));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]