Skip to content

Commit

Permalink
[qt] Simplifies boolean expression model && model->haveWatchOnly()
Browse files Browse the repository at this point in the history
The boolean expression model && model->haveWatchOnly() can be simplified to model->haveWatchOnly(), because if (!model || !model->getOptionsModel()) { return; } guards against a potential dereferenced null pointer.
  • Loading branch information
l2a5b1 committed Jan 2, 2018
1 parent 63a4dc1 commit 6dda059
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/qt/transactionview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ void TransactionView::exportClicked()
// name, column, role
writer.setModel(transactionProxyModel);
writer.addColumn(tr("Confirmed"), 0, TransactionTableModel::ConfirmedRole);
if (model && model->haveWatchOnly())
if (model->haveWatchOnly())
writer.addColumn(tr("Watch-only"), TransactionTableModel::Watchonly);
writer.addColumn(tr("Date"), 0, TransactionTableModel::DateRole);
writer.addColumn(tr("Type"), TransactionTableModel::Type, Qt::EditRole);
Expand Down

0 comments on commit 6dda059

Please sign in to comment.