mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
fix(profile): don't error if no new avatar is selected
This commit is contained in:
parent
ff578413c1
commit
cfdc1cdb2e
|
@ -314,6 +314,9 @@ void ProfileForm::onAvatarClicked()
|
||||||
const QString path = QFileDialog::getOpenFileName(Q_NULLPTR, tr("Choose a profile picture"),
|
const QString path = QFileDialog::getOpenFileName(Q_NULLPTR, tr("Choose a profile picture"),
|
||||||
QDir::homePath(), filter, nullptr);
|
QDir::homePath(), filter, nullptr);
|
||||||
|
|
||||||
|
if (path.isEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
const IProfileInfo::SetAvatarResult result = profileInfo->setAvatar(path);
|
const IProfileInfo::SetAvatarResult result = profileInfo->setAvatar(path);
|
||||||
if (result == IProfileInfo::SetAvatarResult::OK) {
|
if (result == IProfileInfo::SetAvatarResult::OK) {
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user