1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

refactor: Comply with Wnull-dereference

* Add check before dereferencing return from qobject_cast
This commit is contained in:
Anthony Bilinski 2022-03-11 08:23:00 -08:00
parent 17043dbc45
commit 3a03c8f043
No known key found for this signature in database
GPG Key ID: 2AA8E0DA1B31FB3C

View File

@ -580,7 +580,8 @@ bool GenericChatForm::eventFilter(QObject* object, QEvent* event)
if (object != fileButton && object != fileFlyout)
return false;
if (!qobject_cast<QWidget*>(object)->isEnabled())
auto wObject = qobject_cast<QWidget*>(object);
if (!wObject || !wObject->isEnabled())
return false;
switch (event->type()) {