diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2013-08-23 22:34:51 -0700 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2013-08-23 22:34:51 -0700 |
commit | e9e2ef5fbd610fbaa3801440254c39ac4ba8f91d (patch) | |
tree | 3d92b37a0b7357fb40d70d0d5e04873a52719652 /src/qt/sendcoinsdialog.cpp | |
parent | b60012f2b6770105557db2af40dc34947e884330 (diff) | |
parent | 6728e007767fbb2f8eebc1936a3386adda1dbd3f (diff) | |
download | bitcoin-e9e2ef5fbd610fbaa3801440254c39ac4ba8f91d.tar.xz |
Merge pull request #2926 from Diapolo/model_checks
Bitcoin-Qt: extend some checks for valid model pointers
Diffstat (limited to 'src/qt/sendcoinsdialog.cpp')
-rw-r--r-- | src/qt/sendcoinsdialog.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp index 09d83b1a29..9086f6614e 100644 --- a/src/qt/sendcoinsdialog.cpp +++ b/src/qt/sendcoinsdialog.cpp @@ -39,16 +39,17 @@ void SendCoinsDialog::setModel(WalletModel *model) { this->model = model; - for(int i = 0; i < ui->entries->count(); ++i) + if(model && model->getOptionsModel()) { - SendCoinsEntry *entry = qobject_cast<SendCoinsEntry*>(ui->entries->itemAt(i)->widget()); - if(entry) + for(int i = 0; i < ui->entries->count(); ++i) { - entry->setModel(model); + SendCoinsEntry *entry = qobject_cast<SendCoinsEntry*>(ui->entries->itemAt(i)->widget()); + if(entry) + { + entry->setModel(model); + } } - } - if(model && model->getOptionsModel()) - { + setBalance(model->getBalance(), model->getUnconfirmedBalance(), model->getImmatureBalance()); connect(model, SIGNAL(balanceChanged(qint64, qint64, qint64)), this, SLOT(setBalance(qint64, qint64, qint64))); connect(model->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit())); |