Skip to content

Commit 10d10d7

Browse files
committed
Merge #12211: Avoid potential null dereference in ReceiveCoinsDialog constructor
cc90a4f Avoid potential null dereference in ReceiveCoinsDialog constructor (Russell Yanofsky) Pull request description: Not a bug in practice because current `WalletModel::getDefaultAddressType()` implementation does not dereference its `this` pointer. Encountered issue while rebasing #10244 after #11991 was merged. Tree-SHA512: d76afc410d4a436ec62936196fdac1af89c221d8c0d6e73349024afe55bbf8820f843177a8fe8210aa8021d45a17a0ecd9b6f693381e3edb234d9897cece29d7
2 parents 898f560 + cc90a4f commit 10d10d7

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/qt/receivecoinsdialog.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,6 @@ ReceiveCoinsDialog::ReceiveCoinsDialog(const PlatformStyle *_platformStyle, QWid
4343
ui->removeRequestButton->setIcon(_platformStyle->SingleColorIcon(":/icons/remove"));
4444
}
4545

46-
// configure bech32 checkbox, disable if launched with legacy as default:
47-
if (model->getDefaultAddressType() == OUTPUT_TYPE_BECH32) {
48-
ui->useBech32->setCheckState(Qt::Checked);
49-
} else {
50-
ui->useBech32->setCheckState(Qt::Unchecked);
51-
}
52-
53-
ui->useBech32->setVisible(model->getDefaultAddressType() != OUTPUT_TYPE_LEGACY);
54-
5546
// context menu actions
5647
QAction *copyURIAction = new QAction(tr("Copy URI"), this);
5748
QAction *copyLabelAction = new QAction(tr("Copy label"), this);
@@ -102,6 +93,15 @@ void ReceiveCoinsDialog::setModel(WalletModel *_model)
10293
SLOT(recentRequestsView_selectionChanged(QItemSelection, QItemSelection)));
10394
// Last 2 columns are set by the columnResizingFixer, when the table geometry is ready.
10495
columnResizingFixer = new GUIUtil::TableViewLastColumnResizingFixer(tableView, AMOUNT_MINIMUM_COLUMN_WIDTH, DATE_COLUMN_WIDTH, this);
96+
97+
// configure bech32 checkbox, disable if launched with legacy as default:
98+
if (model->getDefaultAddressType() == OUTPUT_TYPE_BECH32) {
99+
ui->useBech32->setCheckState(Qt::Checked);
100+
} else {
101+
ui->useBech32->setCheckState(Qt::Unchecked);
102+
}
103+
104+
ui->useBech32->setVisible(model->getDefaultAddressType() != OUTPUT_TYPE_LEGACY);
105105
}
106106
}
107107

0 commit comments

Comments
 (0)