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:
parent
17043dbc45
commit
3a03c8f043
|
@ -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()) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user