summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2021-02-23 15:14:05 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-02-24 13:02:33 +0000
commit2e00c7996a5e9770d6c0f0951a45925daf04a81e (patch)
tree7e79030a359a4a21b1d5195c562f54abee7671de /src/widgets
parent3ad55194a4a44e08a8e0c7a8bdad3f7594ef6d33 (diff)
Assert that dereferenced pointer is never nullptr
It can't be, since then 'o' (which is never nullptr) would be different, and we'd return in the previous line. Since we test for d->popup a few lines above, help clang static analyzer to not report this with hash 27ff831d79d1779825fd964239cbefe7. Change-Id: I9f0b14bd88418b897cee2d7a63e8a10fc4a0b01c Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit f6c9dec610238bae0d2d61e733d4c29ecf57aa9d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/util/qcompleter.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/widgets/util/qcompleter.cpp b/src/widgets/util/qcompleter.cpp
index 7bfd112f5c..13a28b628c 100644
--- a/src/widgets/util/qcompleter.cpp
+++ b/src/widgets/util/qcompleter.cpp
@@ -1329,6 +1329,7 @@ bool QCompleter::eventFilter(QObject *o, QEvent *e)
if (o != d->popup)
return QObject::eventFilter(o, e);
+ Q_ASSERT(d->popup);
switch (e->type()) {
case QEvent::KeyPress: {
QKeyEvent *ke = static_cast<QKeyEvent *>(e);