[seahorse] pgp/key: Add more precondition checks
- From: Niels De Graef <nielsdg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [seahorse] pgp/key: Add more precondition checks
- Date: Fri, 26 Feb 2021 18:04:09 +0000 (UTC)
commit 91cc1ccc6849587cc158158faf0684008015ce0f
Author: Niels De Graef <nielsdegraef gmail com>
Date: Fri Feb 26 19:03:55 2021 +0100
pgp/key: Add more precondition checks
pgp/seahorse-pgp-key.c | 2 ++
1 file changed, 2 insertions(+)
---
diff --git a/pgp/seahorse-pgp-key.c b/pgp/seahorse-pgp-key.c
index 1789708a..9b4d036d 100644
--- a/pgp/seahorse-pgp-key.c
+++ b/pgp/seahorse-pgp-key.c
@@ -367,6 +367,7 @@ seahorse_pgp_key_add_subkey (SeahorsePgpKey *self,
SeahorsePgpKeyPrivate *priv = seahorse_pgp_key_get_instance_private (self);
g_return_if_fail (SEAHORSE_PGP_IS_KEY (self));
+ g_return_if_fail (SEAHORSE_PGP_IS_SUBKEY (subkey));
/* Don't try to add a key which already exists */
for (guint i = 0; i < g_list_model_get_n_items (priv->subkeys); i++) {
@@ -415,6 +416,7 @@ seahorse_pgp_key_add_photo (SeahorsePgpKey *self,
SeahorsePgpKeyPrivate *priv = seahorse_pgp_key_get_instance_private (self);
g_return_if_fail (SEAHORSE_PGP_IS_KEY (self));
+ g_return_if_fail (SEAHORSE_PGP_IS_PHOTO (photo));
/* Don't try to add a key which already exists */
for (guint i = 0; i < g_list_model_get_n_items (priv->photos); i++) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]