Don't crash on bad userId in local storage.

This commit is contained in:
John Preston 2021-08-25 15:18:47 +03:00
parent 6192413f0b
commit bdc275a927
1 changed files with 6 additions and 0 deletions

View File

@ -153,6 +153,12 @@ void Account::createSession(
const auto flags = MTPDuser::Flag::f_self | (phone.isEmpty()
? MTPDuser::Flag()
: MTPDuser::Flag::f_phone);
using ServerUserIdType = decltype(std::declval<MTPDuser>().vid().v);
if (ServerUserIdType(id.bare) <= 0) { // #TODO ids remove
return;
}
createSession(
MTP_user(
MTP_flags(flags),