#49 - AddressBook crash when doubleclicking

This commit is contained in:
Aditya Kulkarni
2018-11-14 20:42:19 -08:00
parent 4df615509f
commit 121f7b118f
3 changed files with 5 additions and 2 deletions

View File

@@ -128,6 +128,10 @@ void AddressBook::open(MainWindow* parent, QLineEdit* target) {
// Double-Click picks the item
QObject::connect(ab.addresses, &QTableView::doubleClicked, [&] (auto index) {
// If there's no target, then double-clicking does nothing.
if (!target)
return;
if (index.row() < 0) return;
QString lbl = model.itemAt(index.row()).first;