Make sure a protocol implements PurpleProtocolClient before calling those methods

Thu, 05 Jan 2023 21:10:24 -0600

author
Gary Kramlich <grim@reaperworld.com>
date
Thu, 05 Jan 2023 21:10:24 -0600
changeset 42001
63635ba9f117
parent 42000
0b26ebc842db
child 42002
1f9db98e1e6c

Make sure a protocol implements PurpleProtocolClient before calling those methods

Testing Done:
Connected an ircv3 account to libera and verified the crash was gone.

Reviewed at https://reviews.imfreedom.org/r/2176/

libpurple/purpleimconversation.c file | annotate | diff | comparison | revisions
--- a/libpurple/purpleimconversation.c	Tue Jan 03 02:05:24 2023 -0600
+++ b/libpurple/purpleimconversation.c	Thu Jan 05 21:10:24 2023 -0600
@@ -165,8 +165,10 @@
 			purple_serv_send_typing(pc, name, PURPLE_IM_NOT_TYPING);
 		}
 
-		purple_protocol_client_convo_closed(PURPLE_PROTOCOL_CLIENT(protocol),
-		                                    pc, name);
+		if(PURPLE_IS_PROTOCOL_CLIENT(protocol)) {
+			purple_protocol_client_convo_closed(PURPLE_PROTOCOL_CLIENT(protocol),
+			                                    pc, name);
+		}
 	}
 
 	purple_im_conversation_stop_typing_timeout(im);

mercurial