mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 06:26:18 +00:00
Add additional checks to NotificationData::setImage
This commit is contained in:
@@ -669,13 +669,17 @@ void NotificationData::close() {
|
||||
}
|
||||
|
||||
void NotificationData::setImage(const QString &imagePath) {
|
||||
if (_imageKey.empty()) {
|
||||
if (imagePath.isEmpty() || _imageKey.empty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
const auto image = QImage(imagePath)
|
||||
.convertToFormat(QImage::Format_RGBA8888);
|
||||
|
||||
if (image.isNull()) {
|
||||
return;
|
||||
}
|
||||
|
||||
_hints[_imageKey] = MakeGlibVariant(std::tuple{
|
||||
image.width(),
|
||||
image.height(),
|
||||
|
Reference in New Issue
Block a user