[empathy] add g_return_val_if_fail in _new functions



commit 3d2f200b14e889d1ac91b3d081c1c00abd0d2e37
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Thu Aug 12 17:00:15 2010 +0200

    add g_return_val_if_fail in _new functions

 libempathy/empathy-tp-call.c |    1 +
 libempathy/empathy-tp-chat.c |    3 +++
 2 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/libempathy/empathy-tp-call.c b/libempathy/empathy-tp-call.c
index 66fd3f8..9dcf9bf 100644
--- a/libempathy/empathy-tp-call.c
+++ b/libempathy/empathy-tp-call.c
@@ -604,6 +604,7 @@ EmpathyTpCall *
 empathy_tp_call_new (TpAccount *account,
     TpChannel *channel)
 {
+  g_return_val_if_fail (TP_IS_ACCOUNT (account), NULL);
   g_return_val_if_fail (TP_IS_CHANNEL (channel), NULL);
 
   return g_object_new (EMPATHY_TYPE_TP_CALL,
diff --git a/libempathy/empathy-tp-chat.c b/libempathy/empathy-tp-chat.c
index 7bc9a9c..2fd6fc5 100644
--- a/libempathy/empathy-tp-chat.c
+++ b/libempathy/empathy-tp-chat.c
@@ -1545,6 +1545,9 @@ EmpathyTpChat *
 empathy_tp_chat_new (TpAccount *account,
 		     TpChannel *channel)
 {
+	g_return_val_if_fail (TP_IS_ACCOUNT (account), NULL);
+	g_return_val_if_fail (TP_IS_CHANNEL (channel), NULL);
+
 	return g_object_new (EMPATHY_TYPE_TP_CHAT,
 			     "account", account,
 			     "channel", channel,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]