diff options
author | Philip Kaufmann <phil.kaufmann@t-online.de> | 2013-08-23 13:07:20 +0200 |
---|---|---|
committer | Philip Kaufmann <phil.kaufmann@t-online.de> | 2013-08-23 13:07:20 +0200 |
commit | 6728e007767fbb2f8eebc1936a3386adda1dbd3f (patch) | |
tree | 3d92b37a0b7357fb40d70d0d5e04873a52719652 /src | |
parent | b60012f2b6770105557db2af40dc34947e884330 (diff) |
Bitcoin-Qt: extend some checks for valid model pointers
Diffstat (limited to 'src')
-rw-r--r-- | src/qt/sendcoinsdialog.cpp | 15 | ||||
-rw-r--r-- | src/qt/signverifymessagedialog.cpp | 3 |
2 files changed, 11 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())); diff --git a/src/qt/signverifymessagedialog.cpp b/src/qt/signverifymessagedialog.cpp index 9118770f4c..1e9c84fe1a 100644 --- a/src/qt/signverifymessagedialog.cpp +++ b/src/qt/signverifymessagedialog.cpp @@ -102,6 +102,9 @@ void SignVerifyMessageDialog::on_pasteButton_SM_clicked() void SignVerifyMessageDialog::on_signMessageButton_SM_clicked() { + if (!model) + return; + /* Clear old signature to ensure users don't get confused on error with an old signature displayed */ ui->signatureOut_SM->clear(); |