diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2011-11-08 21:18:36 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2011-11-08 21:18:36 +0100 |
commit | dead0ff8cd90eb39f1d9278539d2b3579982b3de (patch) | |
tree | 566823e2886404bf81b3ee94d99ba03497119590 /src/qt/sendcoinsentry.cpp | |
parent | 0fb0a38339e5cb404147c89f73ff10d962a47ca5 (diff) |
Add robustness against null models
Diffstat (limited to 'src/qt/sendcoinsentry.cpp')
-rw-r--r-- | src/qt/sendcoinsentry.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/qt/sendcoinsentry.cpp b/src/qt/sendcoinsentry.cpp index 1802095b3a..23b11ccdde 100644 --- a/src/qt/sendcoinsentry.cpp +++ b/src/qt/sendcoinsentry.cpp @@ -44,6 +44,8 @@ void SendCoinsEntry::on_pasteButton_clicked() void SendCoinsEntry::on_addressBookButton_clicked() { + if(!model) + return; AddressBookPage dlg(AddressBookPage::ForSending, AddressBookPage::SendingTab, this); dlg.setModel(model->getAddressTableModel()); if(dlg.exec()) @@ -55,6 +57,8 @@ void SendCoinsEntry::on_addressBookButton_clicked() void SendCoinsEntry::on_payTo_textChanged(const QString &address) { + if(!model) + return; ui->addAsLabel->setText(model->getAddressTableModel()->labelForAddress(address)); } @@ -74,7 +78,7 @@ void SendCoinsEntry::clear() ui->addAsLabel->clear(); ui->payAmount->clear(); ui->payTo->setFocus(); - if(model) + if(model && model->getOptionsModel()) { ui->payAmount->setDisplayUnit(model->getOptionsModel()->getDisplayUnit()); } |