[gimp] libgimpconfig: relax precondition check in gimp_config_type_register()
- From: Ell <ell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] libgimpconfig: relax precondition check in gimp_config_type_register()
- Date: Mon, 23 Sep 2019 15:27:30 +0000 (UTC)
commit 3d30a036de06049693be7f90d73c4d716df9f9a4
Author: Ell <ell_se yahoo com>
Date: Mon Sep 23 18:22:19 2019 +0300
libgimpconfig: relax precondition check in gimp_config_type_register()
Allow passing a non-NULL `pspecs` with `n_pspecs == 0` to
gimp_config_type_register(), in particular since
g_object_class_list_properties() may return such values.
libgimpconfig/gimpconfig-register.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
---
diff --git a/libgimpconfig/gimpconfig-register.c b/libgimpconfig/gimpconfig-register.c
index d621f726e2..d70e80fe8c 100644
--- a/libgimpconfig/gimpconfig-register.c
+++ b/libgimpconfig/gimpconfig-register.c
@@ -83,8 +83,7 @@ gimp_config_type_register (GType parent_type,
g_return_val_if_fail (g_type_is_a (parent_type, G_TYPE_OBJECT), G_TYPE_NONE);
g_return_val_if_fail (type_name != NULL, G_TYPE_NONE);
- g_return_val_if_fail ((pspecs == NULL && n_pspecs == 0) ||
- (pspecs != NULL && n_pspecs > 0), G_TYPE_NONE);
+ g_return_val_if_fail (pspecs != NULL || n_pspecs == 0, G_TYPE_NONE);
terminated_pspecs = g_new0 (GParamSpec *, n_pspecs + 1);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]