[turbine] Fix applicationData to properly return null
This commit is contained in:
parent
82f02896c9
commit
205f2a698c
@ -99,12 +99,15 @@ template<typename T>
|
|||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
T *applicationData(Context &ctx) noexcept {
|
T *applicationData(Context &ctx) noexcept {
|
||||||
auto const raw = applicationDataRaw(ctx);
|
auto const raw = applicationDataRaw(ctx);
|
||||||
|
if (!raw) [[unlikely]] {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
#ifdef OX_BARE_METAL
|
#ifdef OX_BARE_METAL
|
||||||
auto const out = static_cast<Wrap<T>*>(raw);
|
auto const out = static_cast<Wrap<T>*>(raw);
|
||||||
#else
|
#else
|
||||||
auto const out = dynamic_cast<Wrap<T>*>(raw);
|
auto const out = dynamic_cast<Wrap<T>*>(raw);
|
||||||
#endif
|
#endif
|
||||||
oxAssert(out || !raw, "Cast failed - wrong type");
|
oxAssert(out, "Cast failed - wrong type");
|
||||||
return out->data;
|
return out->data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user