Fix two crashes in own profile photo edit.

This commit is contained in:
John Preston 2022-12-28 23:37:16 +04:00
parent 232fceeee6
commit 71354d1611

View File

@ -91,7 +91,6 @@ void CameraBox(
}, },
std::move(callback), std::move(callback),
track->frame(FrameRequest()).mirrored(true, false)); track->frame(FrameRequest()).mirrored(true, false));
box->closeBox();
}; };
box->setTitle(tr::lng_profile_camera_title()); box->setTitle(tr::lng_profile_camera_title());
@ -274,10 +273,12 @@ void UserpicButton::choosePhotoLocally() {
const auto user = _peer ? _peer->asUser() : nullptr; const auto user = _peer ? _peer->asUser() : nullptr;
const auto name = (user && !user->firstName.isEmpty()) const auto name = (user && !user->firstName.isEmpty())
? user->firstName ? user->firstName
: _peer->name(); : _peer
? _peer->name()
: QString();
const auto phrase = (type == ChosenType::Suggest) const auto phrase = (type == ChosenType::Suggest)
? &tr::lng_profile_suggest_sure ? &tr::lng_profile_suggest_sure
: (_peer->isUser() && !_peer->isSelf()) : (user && !user->isSelf())
? &tr::lng_profile_set_personal_sure ? &tr::lng_profile_set_personal_sure
: nullptr; : nullptr;
PrepareProfilePhotoFromFile( PrepareProfilePhotoFromFile(