Add additional checks to NotificationData::setImage
This commit is contained in:
		
							parent
							
								
									3e8912a53f
								
							
						
					
					
						commit
						087fbe89ce
					
				
					 1 changed files with 5 additions and 1 deletions
				
			
		|  | @ -669,13 +669,17 @@ void NotificationData::close() { | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void NotificationData::setImage(const QString &imagePath) { | void NotificationData::setImage(const QString &imagePath) { | ||||||
| 	if (_imageKey.empty()) { | 	if (imagePath.isEmpty() || _imageKey.empty()) { | ||||||
| 		return; | 		return; | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	const auto image = QImage(imagePath) | 	const auto image = QImage(imagePath) | ||||||
| 		.convertToFormat(QImage::Format_RGBA8888); | 		.convertToFormat(QImage::Format_RGBA8888); | ||||||
| 
 | 
 | ||||||
|  | 	if (image.isNull()) { | ||||||
|  | 		return; | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
| 	_hints[_imageKey] = MakeGlibVariant(std::tuple{ | 	_hints[_imageKey] = MakeGlibVariant(std::tuple{ | ||||||
| 		image.width(), | 		image.width(), | ||||||
| 		image.height(), | 		image.height(), | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Ilya Fedin
						Ilya Fedin