Reply To: php fatal error $message->send()
@garprogram – This fatal error is due to some changes we made in BP v2.4.0 to give users proper feedback messages when a private message fails to send.
It looks like we might have to add some additional hooks so plugin devs can set the error message.
In the meantime, here are two things I would recommend:
1. Use the 'bp_messages_recipients' filter instead of using the 'messages_message_before_save' action:
https://buddypress.trac.wordpress.org/browser/tags/2.4.0/src/bp-messages/bp-messages-actions.php?marks=77-84#L77
2. As Henry mentioned, if you have to unset one recipient, you should unset all of the recipients to avoid the message from sending. The default error message will probably not suit your needs, so you might have to filter the error message with the 'gettext' filter temporarily until we introduce better error handling for plugin developers.