diff options
author | fsb4000 <fsb4000@yandex.ru> | 2015-01-23 20:01:07 +0600 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2015-01-23 16:23:54 +0100 |
commit | ed4206acb1bdc9d23abe30fefd13f9d49a1979b3 (patch) | |
tree | afecaef195536cfe0cf5abe60dbe0644e87a7945 /src/qt/coincontroltreewidget.cpp | |
parent | 58259ad1edf14a4f514fe5f837ac7d1d99b58422 (diff) | |
download | bitcoin-ed4206acb1bdc9d23abe30fefd13f9d49a1979b3.tar.xz |
fix crash: CoinControl "space" bug
Just like https://github.com/novacoin-project/novacoin/commit/baf80c26a2e7f1ba6061d63d174eff0a09111e6f
Github-Pull: #5700
Rebased-From: 944c256741b260bd8b758be4a0543af1cb080943
Diffstat (limited to 'src/qt/coincontroltreewidget.cpp')
-rw-r--r-- | src/qt/coincontroltreewidget.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/qt/coincontroltreewidget.cpp b/src/qt/coincontroltreewidget.cpp index 907b5caa05..0082c9bfd0 100644 --- a/src/qt/coincontroltreewidget.cpp +++ b/src/qt/coincontroltreewidget.cpp @@ -17,7 +17,8 @@ void CoinControlTreeWidget::keyPressEvent(QKeyEvent *event) { event->ignore(); int COLUMN_CHECKBOX = 0; - this->currentItem()->setCheckState(COLUMN_CHECKBOX, ((this->currentItem()->checkState(COLUMN_CHECKBOX) == Qt::Checked) ? Qt::Unchecked : Qt::Checked)); + if(this->currentItem()) + this->currentItem()->setCheckState(COLUMN_CHECKBOX, ((this->currentItem()->checkState(COLUMN_CHECKBOX) == Qt::Checked) ? Qt::Unchecked : Qt::Checked)); } else if (event->key() == Qt::Key_Escape) // press esc -> close dialog { @@ -29,4 +30,4 @@ void CoinControlTreeWidget::keyPressEvent(QKeyEvent *event) { this->QTreeWidget::keyPressEvent(event); } -}
\ No newline at end of file +} |