Fix crash when trying to close empty tab

This commit is contained in:
suter_a 2019-04-01 09:03:29 +02:00
parent fec5017fc2
commit 15692b89e7

View File

@ -1368,8 +1368,13 @@ void PTextEdit::filePrint()
*/
void PTextEdit::fileClose(const bool check)
{
// first check if there is any tab present
if (fTabWidget->count()==0) // no tabs present
return;
// check if the has modification
int idx = fTabWidget->currentIndex();
if ((fTabWidget->tabText(idx).indexOf("*")>0) && check) {
int result = QMessageBox::warning(this, "**WARNING**",
"Do you really want to close this file.\nChanges will be lost",