Merge pull request #618 from laanwj/issue615

Fix segmentation fault when editing address not in address book (issue #615)
This commit is contained in:
Wladimir J. van der Laan 2011-11-08 11:01:56 -08:00
commit 0fb0a38339
3 changed files with 11 additions and 0 deletions

View file

@ -113,3 +113,9 @@ QString EditAddressDialog::getAddress() const
{
return address;
}
void EditAddressDialog::setAddress(const QString &address)
{
this->address = address;
ui->addressEdit->setText(address);
}

View file

@ -33,6 +33,7 @@ public:
void accept();
QString getAddress() const;
void setAddress(const QString &address);
private:
bool saveCurrentRow();

View file

@ -322,6 +322,8 @@ void TransactionView::editLabel()
// If this transaction has no associated address, exit
return;
}
// Is address in address book? Address book can miss address when a transaction is
// sent from outside the UI.
int idx = addressBook->lookupAddress(address);
if(idx != -1)
{
@ -343,6 +345,8 @@ void TransactionView::editLabel()
// Add sending address
EditAddressDialog dlg(EditAddressDialog::NewSendingAddress,
this);
dlg.setModel(addressBook);
dlg.setAddress(address);
dlg.exec();
}
}