[turbine] Fix applicationData to properly return null
This commit is contained in:
parent
82f02896c9
commit
205f2a698c
@ -99,12 +99,15 @@ template<typename T>
|
||||
[[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<Wrap<T>*>(raw);
|
||||
#else
|
||||
auto const out = dynamic_cast<Wrap<T>*>(raw);
|
||||
#endif
|
||||
oxAssert(out || !raw, "Cast failed - wrong type");
|
||||
oxAssert(out, "Cast failed - wrong type");
|
||||
return out->data;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user