[gnome-software: 1/4] gs-age-rating-context-dialog: Clarify an invariant
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software: 1/4] gs-age-rating-context-dialog: Clarify an invariant
- Date: Fri, 13 Aug 2021 15:35:45 +0000 (UTC)
commit 69f63a5aa362373400e0a4cc17b184fea862658e
Author: Philip Withnall <pwithnall endlessos org>
Date: Fri Aug 13 16:28:19 2021 +0100
gs-age-rating-context-dialog: Clarify an invariant
This was otherwise giving a `-Wmaybe-uninitialized` warning for `age`.
Signed-off-by: Philip Withnall <pwithnall endlessos org>
src/gs-age-rating-context-dialog.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/gs-age-rating-context-dialog.c b/src/gs-age-rating-context-dialog.c
index 2eccd1d39..82526ab31 100644
--- a/src/gs-age-rating-context-dialog.c
+++ b/src/gs-age-rating-context-dialog.c
@@ -674,8 +674,9 @@ update_attributes_list (GsAgeRatingContextDialog *self)
} else {
guint age;
- if (content_rating != NULL)
- age = as_content_rating_get_minimum_age (content_rating);
+ /* if content_rating is NULL, is_unknown should be TRUE */
+ g_assert (content_rating != NULL);
+ age = as_content_rating_get_minimum_age (content_rating);
if (age == 0)
/* Translators: This is a dialogue title which indicates that an app is suitable
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]