aboutsummaryrefslogtreecommitdiff
path: root/lib/events
diff options
context:
space:
mode:
Diffstat (limited to 'lib/events')
-rw-r--r--lib/events/event.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/events/event.h b/lib/events/event.h
index 043d4f54..b7454337 100644
--- a/lib/events/event.h
+++ b/lib/events/event.h
@@ -343,9 +343,9 @@ template <class EventT, typename BasePtrT>
inline auto eventCast(const BasePtrT& eptr)
-> decltype(static_cast<EventT*>(&*eptr))
{
- Q_ASSERT(eptr);
- return is<std::decay_t<EventT>>(*eptr) ? static_cast<EventT*>(&*eptr)
- : nullptr;
+ return eptr && is<std::decay_t<EventT>>(*eptr)
+ ? static_cast<EventT*>(&*eptr)
+ : nullptr;
}
//! \brief Cast the event pointer down in a type-safe way, with moving