summaryrefslogtreecommitdiffstats
path: root/mainwindow.cpp
diff options
context:
space:
mode:
authorAnne Jan Brouwer <brouwer@annejan.com>2016-11-19 18:56:09 +0100
committerJanosch Knack <j.knack@micromata.com>2016-11-20 10:02:54 +0100
commita2f3c16cfd130a5c3203643762e6d3f82bc91996 (patch)
treefeb32f8eea5a26c9f8ba369fd2b30afa08ad0192 /mainwindow.cpp
parent0c893cc4e589c1b4722e676b1e1cb9008bd62780 (diff)
Fixed unchecked dynamic_cast (FORWARD_NULL)
Diffstat (limited to 'mainwindow.cpp')
-rw-r--r--mainwindow.cpp8
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);
}