diff options
author | Anne Jan Brouwer <brouwer@annejan.com> | 2016-11-19 18:56:09 +0100 |
---|---|---|
committer | Janosch Knack <j.knack@micromata.com> | 2016-11-20 10:02:54 +0100 |
commit | a2f3c16cfd130a5c3203643762e6d3f82bc91996 (patch) | |
tree | feb32f8eea5a26c9f8ba369fd2b30afa08ad0192 /mainwindow.cpp | |
parent | 0c893cc4e589c1b4722e676b1e1cb9008bd62780 (diff) |
Fixed unchecked dynamic_cast (FORWARD_NULL)
Diffstat (limited to 'mainwindow.cpp')
-rw-r--r-- | mainwindow.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/mainwindow.cpp b/mainwindow.cpp index 3328cefd..7b9f6f94 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -1884,8 +1884,12 @@ void MainWindow::copyTextByButtonClick(bool checked) { if (checked) { qDebug() << "checked"; } - QString textToCopy = - dynamic_cast<QPushButtonWithClipboard *>(sender())->getTextToCopy(); + QPushButtonWithClipboard *button = + dynamic_cast<QPushButtonWithClipboard *>(sender()); + if (button == NULL) { + return; + } + QString textToCopy = button->getTextToCopy(); copyTextToClipboard(textToCopy); } |