aboutsummaryrefslogtreecommitdiff
path: root/src/qt/receivecoinsdialog.cpp
diff options
context:
space:
mode:
authorRussell Yanofsky <russ@yanofsky.org>2018-01-17 13:23:26 -0500
committerRussell Yanofsky <russ@yanofsky.org>2018-01-17 13:23:26 -0500
commitcc90a4f46bfff17ca358eedf29d2b77117ad4465 (patch)
tree96a2e1654993d88f974ff6b2c173b66e51fbc336 /src/qt/receivecoinsdialog.cpp
parentc7978be899646194b6abc5b34a7f6a3311490033 (diff)
downloadbitcoin-cc90a4f46bfff17ca358eedf29d2b77117ad4465.tar.xz
Avoid potential null dereference in ReceiveCoinsDialog constructor
Not a bug in practice because current WalletModel::getDefaultAddressType() implementation does not dereference its `this` pointer.
Diffstat (limited to 'src/qt/receivecoinsdialog.cpp')
-rw-r--r--src/qt/receivecoinsdialog.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/qt/receivecoinsdialog.cpp b/src/qt/receivecoinsdialog.cpp
index f6c2fa7de7..7fd5285467 100644
--- a/src/qt/receivecoinsdialog.cpp
+++ b/src/qt/receivecoinsdialog.cpp
@@ -43,15 +43,6 @@ ReceiveCoinsDialog::ReceiveCoinsDialog(const PlatformStyle *_platformStyle, QWid
ui->removeRequestButton->setIcon(_platformStyle->SingleColorIcon(":/icons/remove"));
}
- // configure bech32 checkbox, disable if launched with legacy as default:
- if (model->getDefaultAddressType() == OUTPUT_TYPE_BECH32) {
- ui->useBech32->setCheckState(Qt::Checked);
- } else {
- ui->useBech32->setCheckState(Qt::Unchecked);
- }
-
- ui->useBech32->setVisible(model->getDefaultAddressType() != OUTPUT_TYPE_LEGACY);
-
// context menu actions
QAction *copyURIAction = new QAction(tr("Copy URI"), this);
QAction *copyLabelAction = new QAction(tr("Copy label"), this);
@@ -102,6 +93,15 @@ void ReceiveCoinsDialog::setModel(WalletModel *_model)
SLOT(recentRequestsView_selectionChanged(QItemSelection, QItemSelection)));
// Last 2 columns are set by the columnResizingFixer, when the table geometry is ready.
columnResizingFixer = new GUIUtil::TableViewLastColumnResizingFixer(tableView, AMOUNT_MINIMUM_COLUMN_WIDTH, DATE_COLUMN_WIDTH, this);
+
+ // configure bech32 checkbox, disable if launched with legacy as default:
+ if (model->getDefaultAddressType() == OUTPUT_TYPE_BECH32) {
+ ui->useBech32->setCheckState(Qt::Checked);
+ } else {
+ ui->useBech32->setCheckState(Qt::Unchecked);
+ }
+
+ ui->useBech32->setVisible(model->getDefaultAddressType() != OUTPUT_TYPE_LEGACY);
}
}