1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

Fix crash when re-adding friend

Blatant lack of error handling.
This commit is contained in:
Tux3 / Mlkj / !Lev.uXFMLA 2014-11-11 15:19:14 +01:00
parent 722aeb776e
commit bd6795bf73
No known key found for this signature in database
GPG Key ID: 7E086DD661263264
2 changed files with 3 additions and 1 deletions

View File

@ -1793,7 +1793,7 @@ QString Core::getPeerName(const ToxID& id) const
const int nameSize = tox_get_name_size(tox, friendId);
if (nameSize <= 0)
{
qWarning() << "Core::getPeerName: Can't get name of friend "+QString().setNum(friendId)+" ("+id.toString()+")";
//qDebug() << "Core::getPeerName: Can't get name of friend "+QString().setNum(friendId)+" ("+id.toString()+")";
return name;
}

View File

@ -64,6 +64,8 @@ Friend* FriendList::findFriend(QString userId)
if (id != tox2id.end())
{
Friend *f = findFriend(*id);
if (!f)
return nullptr;
if (f->getToxID() == ToxID::fromString(userId))
return f;
}