Fix crash in channel setup box.
This commit is contained in:
		
							parent
							
								
									684ce09bb5
								
							
						
					
					
						commit
						1b19e870c0
					
				
					 1 changed files with 12 additions and 13 deletions
				
			
		| 
						 | 
					@ -773,26 +773,25 @@ void SetupChannelBox::updateSelected(const QPoint &cursorGlobalPosition) {
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void SetupChannelBox::save() {
 | 
					void SetupChannelBox::save() {
 | 
				
			||||||
	if (_privacyGroup->value() == Privacy::Private) {
 | 
						if (_saveRequestId) {
 | 
				
			||||||
 | 
							return;
 | 
				
			||||||
 | 
						} else if (_privacyGroup->value() == Privacy::Private) {
 | 
				
			||||||
		if (_existing) {
 | 
							if (_existing) {
 | 
				
			||||||
			_sentUsername = QString();
 | 
								_sentUsername = QString();
 | 
				
			||||||
			_saveRequestId = MTP::send(MTPchannels_UpdateUsername(_channel->inputChannel, MTP_string(_sentUsername)), rpcDone(&SetupChannelBox::onUpdateDone), rpcFail(&SetupChannelBox::onUpdateFail));
 | 
								_saveRequestId = MTP::send(MTPchannels_UpdateUsername(_channel->inputChannel, MTP_string(_sentUsername)), rpcDone(&SetupChannelBox::onUpdateDone), rpcFail(&SetupChannelBox::onUpdateFail));
 | 
				
			||||||
		} else {
 | 
							} else {
 | 
				
			||||||
			closeBox();
 | 
								closeBox();
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						} else {
 | 
				
			||||||
 | 
							const auto link = _link->text().trimmed();
 | 
				
			||||||
	if (_saveRequestId) return;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	QString link = _link->text().trimmed();
 | 
					 | 
				
			||||||
		if (link.isEmpty()) {
 | 
							if (link.isEmpty()) {
 | 
				
			||||||
			_link->setFocus();
 | 
								_link->setFocus();
 | 
				
			||||||
			_link->showError();
 | 
								_link->showError();
 | 
				
			||||||
			return;
 | 
								return;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					 | 
				
			||||||
		_sentUsername = link;
 | 
							_sentUsername = link;
 | 
				
			||||||
		_saveRequestId = MTP::send(MTPchannels_UpdateUsername(_channel->inputChannel, MTP_string(_sentUsername)), rpcDone(&SetupChannelBox::onUpdateDone), rpcFail(&SetupChannelBox::onUpdateFail));
 | 
							_saveRequestId = MTP::send(MTPchannels_UpdateUsername(_channel->inputChannel, MTP_string(_sentUsername)), rpcDone(&SetupChannelBox::onUpdateDone), rpcFail(&SetupChannelBox::onUpdateFail));
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void SetupChannelBox::handleChange() {
 | 
					void SetupChannelBox::handleChange() {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue