{
char* pName = pProxy->GetLocalPortNameN(id);
bool trusted = false;
- pProxy->CheckTrustedLocalPort(id, &trusted);
+ ret = pProxy->CheckTrustedLocalPort(id, &trusted);
+ if (ret < 0)
+ {
+ return MESSAGEPORT_ERROR_INVALID_PARAMETER;
+ }
ret = pProxy->SendMessage(pName, trusted, remote_app_id, remote_port, false, message);