mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-08 10:31:50 -05:00
Bitcoin-Qt: extend some checks for valid model pointers
This commit is contained in:
parent
b60012f2b6
commit
6728e00776
2 changed files with 12 additions and 8 deletions
|
@ -39,16 +39,17 @@ void SendCoinsDialog::setModel(WalletModel *model)
|
||||||
{
|
{
|
||||||
this->model = model;
|
this->model = model;
|
||||||
|
|
||||||
for(int i = 0; i < ui->entries->count(); ++i)
|
|
||||||
{
|
|
||||||
SendCoinsEntry *entry = qobject_cast<SendCoinsEntry*>(ui->entries->itemAt(i)->widget());
|
|
||||||
if(entry)
|
|
||||||
{
|
|
||||||
entry->setModel(model);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(model && model->getOptionsModel())
|
if(model && model->getOptionsModel())
|
||||||
{
|
{
|
||||||
|
for(int i = 0; i < ui->entries->count(); ++i)
|
||||||
|
{
|
||||||
|
SendCoinsEntry *entry = qobject_cast<SendCoinsEntry*>(ui->entries->itemAt(i)->widget());
|
||||||
|
if(entry)
|
||||||
|
{
|
||||||
|
entry->setModel(model);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
setBalance(model->getBalance(), model->getUnconfirmedBalance(), model->getImmatureBalance());
|
setBalance(model->getBalance(), model->getUnconfirmedBalance(), model->getImmatureBalance());
|
||||||
connect(model, SIGNAL(balanceChanged(qint64, qint64, qint64)), this, SLOT(setBalance(qint64, qint64, qint64)));
|
connect(model, SIGNAL(balanceChanged(qint64, qint64, qint64)), this, SLOT(setBalance(qint64, qint64, qint64)));
|
||||||
connect(model->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit()));
|
connect(model->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit()));
|
||||||
|
|
|
@ -102,6 +102,9 @@ void SignVerifyMessageDialog::on_pasteButton_SM_clicked()
|
||||||
|
|
||||||
void SignVerifyMessageDialog::on_signMessageButton_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 */
|
/* Clear old signature to ensure users don't get confused on error with an old signature displayed */
|
||||||
ui->signatureOut_SM->clear();
|
ui->signatureOut_SM->clear();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue