From d4b8f54f764bec5758c8f672d4ab05d59e02c269 Mon Sep 17 00:00:00 2001 From: Alexey Rusakov Date: Sat, 30 Jul 2022 07:37:15 +0200 Subject: moving eventCast(): disallow passing nullptr This is aligned with the non-moving version. --- lib/events/event.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/events') 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 inline auto eventCast(const BasePtrT& eptr) -> decltype(static_cast(&*eptr)) { - Q_ASSERT(eptr); - return is>(*eptr) ? static_cast(&*eptr) - : nullptr; + return eptr && is>(*eptr) + ? static_cast(&*eptr) + : nullptr; } //! \brief Cast the event pointer down in a type-safe way, with moving -- cgit v1.2.3