Added a null check for the Send and Group methods in Hub and Persistent Connection

- Added the corresponding unit tests for the null cases

#1265