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:
parent
722aeb776e
commit
bd6795bf73
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user