mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
Handle personnal save corruption better
This commit is contained in:
parent
adad71e565
commit
036d307302
|
@ -364,6 +364,11 @@ void SettingsSerializer::readSerialized()
|
|||
beginReadArray(QString::fromUtf8(prefix));
|
||||
QByteArray sizeData;
|
||||
stream >> sizeData;
|
||||
if (sizeData.isEmpty())
|
||||
{
|
||||
qWarning("The personnal save file is corrupted!");
|
||||
return;
|
||||
}
|
||||
quint64 size = dataToVUint(sizeData);
|
||||
arrays[array].size = max(size, arrays[array].size);
|
||||
//qDebug()<<"!Array start"<<prefix;
|
||||
|
@ -372,6 +377,11 @@ void SettingsSerializer::readSerialized()
|
|||
{
|
||||
QByteArray indexData;
|
||||
stream >> indexData;
|
||||
if (indexData.isEmpty())
|
||||
{
|
||||
qWarning("The personnal save file is corrupted!");
|
||||
return;
|
||||
}
|
||||
quint64 index = dataToVUint(indexData);
|
||||
setArrayIndex(index);
|
||||
QByteArray key;
|
||||
|
|
Loading…
Reference in New Issue
Block a user