mirror of https://github.com/procxx/kepka.git
				
				
				
			Fix crash in history clear.
This commit is contained in:
		
							parent
							
								
									60e36b1411
								
							
						
					
					
						commit
						cc8f4aa24f
					
				| 
						 | 
					@ -2947,8 +2947,8 @@ void History::clear(ClearType type) {
 | 
				
			||||||
		changeUnreadCount(-unreadCount());
 | 
							changeUnreadCount(-unreadCount());
 | 
				
			||||||
		if (type == ClearType::DeleteChat) {
 | 
							if (type == ClearType::DeleteChat) {
 | 
				
			||||||
			setLastMessage(nullptr);
 | 
								setLastMessage(nullptr);
 | 
				
			||||||
		} else {
 | 
							} else if (_lastMessage && *_lastMessage) {
 | 
				
			||||||
			if (_lastMessage && IsServerMsgId((*_lastMessage)->id)) {
 | 
								if (IsServerMsgId((*_lastMessage)->id)) {
 | 
				
			||||||
				(*_lastMessage)->applyEditionToHistoryCleared();
 | 
									(*_lastMessage)->applyEditionToHistoryCleared();
 | 
				
			||||||
			} else {
 | 
								} else {
 | 
				
			||||||
				_lastMessage = std::nullopt;
 | 
									_lastMessage = std::nullopt;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue