Added check code to prevent the protocol crashing in certain situations.
This commit is contained in:
parent
0237a48a53
commit
fd546ea9ae
|
@ -194,7 +194,8 @@ MSNP::MSNP()
|
|||
looper->Run();
|
||||
fAvatarRunner = new BMessageRunner(*mess, new BMessage(kAvatarCheckMessage), fRunnerTime);
|
||||
if (fAvatarRunner->InitCheck() != B_OK) {
|
||||
printf("Avatar MessageRunner error %s\n", fAvatarRunner->InitCheck());
|
||||
printf("Avatar MessageRunner error %s\n",
|
||||
strerror(fAvatarRunner->InitCheck()));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -408,8 +409,10 @@ MSNP::Process(BMessage* msg)
|
|||
fMainConnection->requestSwitchboardConnection(container);
|
||||
} else {
|
||||
MSN::SwitchboardServerConnection* conn = fSwitchboardList.ItemAt(y)->second;
|
||||
if (conn != NULL && conn->isConnected()) {
|
||||
conn->sendTypingNotification();
|
||||
conn->sendMessage(string(sms));
|
||||
}
|
||||
|
||||
BMessage msg(IM_MESSAGE);
|
||||
msg.AddInt32("im_what", IM_MESSAGE_SENT);
|
||||
|
@ -440,6 +443,7 @@ MSNP::Process(BMessage* msg)
|
|||
if (count != 0) {
|
||||
for (x=0; x < count; x++) {
|
||||
if (fSwitchboardList.ItemAt(x)->first == id) {
|
||||
if (fSwitchboardList.ItemAt(x)->second != NULL)
|
||||
fSwitchboardList.ItemAt(x)->second->sendTypingNotification();
|
||||
break;
|
||||
}
|
||||
|
|
Ŝarĝante…
Reference in New Issue