mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Fix crash in unloaded null Image.
This commit is contained in:
parent
906122a334
commit
88a82eecf3
1 changed files with 6 additions and 4 deletions
|
@ -43,12 +43,14 @@ QImage ImageSource::takeLoaded() {
|
||||||
|
|
||||||
void ImageSource::unload() {
|
void ImageSource::unload() {
|
||||||
if (_bytes.isEmpty() && !_data.isNull()) {
|
if (_bytes.isEmpty() && !_data.isNull()) {
|
||||||
if (_format.isEmpty()) {
|
if (_format != "JPG") {
|
||||||
_format = "PNG";
|
_format = "PNG";
|
||||||
}
|
}
|
||||||
|
{
|
||||||
QBuffer buffer(&_bytes);
|
QBuffer buffer(&_bytes);
|
||||||
_data.save(&buffer, _format);
|
_data.save(&buffer, _format);
|
||||||
|
}
|
||||||
|
Assert(!_bytes.isEmpty());
|
||||||
}
|
}
|
||||||
_data = QImage();
|
_data = QImage();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue