summaryrefslogtreecommitdiff
path: root/libappstream-glib/as-agreement-section.c
diff options
context:
space:
mode:
authorRobert Ancell <robert.ancell@canonical.com>2018-06-22 11:11:20 +1200
committerRobert Ancell <robert.ancell@canonical.com>2018-06-27 09:50:15 +1200
commit4f62fd022659ff9744559782029ba0e0f12d8a72 (patch)
tree289fdc53c8023eac29512b0863a991c925c38e3d /libappstream-glib/as-agreement-section.c
parente03a5f33a7beb482ab97c7c9235d568219c84e5b (diff)
downloadappstream-glib-4f62fd022659ff9744559782029ba0e0f12d8a72.tar.gz
Add object type checks on the inputs of all functions
Diffstat (limited to 'libappstream-glib/as-agreement-section.c')
-rw-r--r--libappstream-glib/as-agreement-section.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libappstream-glib/as-agreement-section.c b/libappstream-glib/as-agreement-section.c
index aa29098..42ece60 100644
--- a/libappstream-glib/as-agreement-section.c
+++ b/libappstream-glib/as-agreement-section.c
@@ -90,6 +90,7 @@ const gchar *
as_agreement_section_get_kind (AsAgreementSection *agreement_section)
{
AsAgreementSectionPrivate *priv = GET_PRIVATE (agreement_section);
+ g_return_val_if_fail (AS_IS_AGREEMENT_SECTION (agreement_section), NULL);
return priv->kind;
}
@@ -106,6 +107,7 @@ void
as_agreement_section_set_kind (AsAgreementSection *agreement_section, const gchar *kind)
{
AsAgreementSectionPrivate *priv = GET_PRIVATE (agreement_section);
+ g_return_if_fail (AS_IS_AGREEMENT_SECTION (agreement_section));
as_ref_string_assign_safe (&priv->kind, kind);
}
@@ -124,6 +126,7 @@ const gchar *
as_agreement_section_get_name (AsAgreementSection *agreement_section, const gchar *locale)
{
AsAgreementSectionPrivate *priv = GET_PRIVATE (agreement_section);
+ g_return_val_if_fail (AS_IS_AGREEMENT_SECTION (agreement_section), NULL);
return priv->name;
}
@@ -142,6 +145,7 @@ as_agreement_section_set_name (AsAgreementSection *agreement_section,
const gchar *locale, const gchar *name)
{
AsAgreementSectionPrivate *priv = GET_PRIVATE (agreement_section);
+ g_return_if_fail (AS_IS_AGREEMENT_SECTION (agreement_section));
as_ref_string_assign_safe (&priv->name, name);
}
@@ -161,6 +165,7 @@ as_agreement_section_get_description (AsAgreementSection *agreement_section,
const gchar *locale)
{
AsAgreementSectionPrivate *priv = GET_PRIVATE (agreement_section);
+ g_return_val_if_fail (AS_IS_AGREEMENT_SECTION (agreement_section), NULL);
return priv->desc;
}
@@ -179,6 +184,7 @@ as_agreement_section_set_description (AsAgreementSection *agreement_section,
const gchar *locale, const gchar *desc)
{
AsAgreementSectionPrivate *priv = GET_PRIVATE (agreement_section);
+ g_return_if_fail (AS_IS_AGREEMENT_SECTION (agreement_section));
as_ref_string_assign_safe (&priv->desc, desc);
}
@@ -200,6 +206,7 @@ as_agreement_section_node_insert (AsAgreementSection *agreement_section,
AsNodeContext *ctx)
{
AsAgreementSectionPrivate *priv = GET_PRIVATE (agreement_section);
+ g_return_val_if_fail (AS_IS_AGREEMENT_SECTION (agreement_section), NULL);
GNode *n = as_node_insert (parent, "agreement_section", NULL,
AS_NODE_INSERT_FLAG_NONE,
NULL);