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
1 changed files with 4 additions and 3 deletions

View File

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