From 205f2a698c2a71cb9734afd0f4cb00a55615723a Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Sun, 17 Mar 2024 20:05:01 -0500 Subject: [PATCH] [turbine] Fix applicationData to properly return null --- src/olympic/turbine/include/turbine/context.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/olympic/turbine/include/turbine/context.hpp b/src/olympic/turbine/include/turbine/context.hpp index 05f39b76..7d513c4f 100644 --- a/src/olympic/turbine/include/turbine/context.hpp +++ b/src/olympic/turbine/include/turbine/context.hpp @@ -99,12 +99,15 @@ template [[nodiscard]] T *applicationData(Context &ctx) noexcept { auto const raw = applicationDataRaw(ctx); + if (!raw) [[unlikely]] { + return nullptr; + } #ifdef OX_BARE_METAL auto const out = static_cast*>(raw); #else auto const out = dynamic_cast*>(raw); #endif - oxAssert(out || !raw, "Cast failed - wrong type"); + oxAssert(out, "Cast failed - wrong type"); return out->data; }