mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 10:22:48 +00:00
solid: check if the object is null before qobject_cast<T>()-ing it in return_SOLID_CALL() macro
fixes possible crashes, notably on FreeBSD the backend of which does not implement all interfaces Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
b46e8b1170
commit
5e8ef901ce
1 changed files with 4 additions and 1 deletions
|
@ -24,8 +24,11 @@
|
|||
#include <QtCore/QObject>
|
||||
|
||||
#define return_SOLID_CALL(Type, Object, Default, Method) \
|
||||
if (Object == nullptr) { \
|
||||
return Default; \
|
||||
} \
|
||||
Type t = qobject_cast<Type>(Object); \
|
||||
if (t!=0) \
|
||||
if (t != nullptr) \
|
||||
{ \
|
||||
return t->Method; \
|
||||
} \
|
||||
|
|
Loading…
Add table
Reference in a new issue