aboutsummaryrefslogtreecommitdiff
path: root/src/qt/sendcoinsdialog.cpp
diff options
context:
space:
mode:
authorPhilip Kaufmann <phil.kaufmann@t-online.de>2013-08-23 13:07:20 +0200
committerPhilip Kaufmann <phil.kaufmann@t-online.de>2013-08-23 13:07:20 +0200
commit6728e007767fbb2f8eebc1936a3386adda1dbd3f (patch)
tree3d92b37a0b7357fb40d70d0d5e04873a52719652 /src/qt/sendcoinsdialog.cpp
parentb60012f2b6770105557db2af40dc34947e884330 (diff)
Bitcoin-Qt: extend some checks for valid model pointers
Diffstat (limited to 'src/qt/sendcoinsdialog.cpp')
-rw-r--r--src/qt/sendcoinsdialog.cpp15
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()));