Fix crash when clicking close button with no tabs open.

This commit is contained in:
eelke 2017-02-19 14:45:37 +01:00
parent 161de60eb1
commit f5046fbd68

View file

@ -208,7 +208,7 @@ void MainWindow::on_tabWidget_tabCloseRequested(int index)
{
QWidget *widget = ui->tabWidget->widget(index);
QueryTab *qt = dynamic_cast<QueryTab*>(widget);
if (qt->canClose()) {
if (qt && qt->canClose()) {
ui->tabWidget->removeTab(index);
}