void MainWindow::updatePackageDetails(const QModelIndex& index) { descriptionTabs->show(); descriptionTabs->setEnabled(false); PkPackage *p = packageModel->packageAtIndex(index); // !p happens when the model gets cleared, because the view changes current if(!p) return; currentPackageId = p->id(); ///////////////////// This is the faulty line pkController->getDescription(p); }