[nostalgia/core] Handle error in getting preload addr
This commit is contained in:
parent
517ffddf04
commit
b39a125264
@ -58,7 +58,8 @@ ox::Result<AssetRef<T>> readObj(Context *ctx, const ox::FileAddress &file,
|
||||
}
|
||||
#else
|
||||
if constexpr(ox::preloadable<T>::value) {
|
||||
return AssetRef<T>{*reinterpret_cast<T*>(getPreloadAddr(ctx, file))};
|
||||
oxRequire(addr, getPreloadAddr(ctx, file));
|
||||
return AssetRef<T>(reinterpret_cast<const T*>(addr));
|
||||
} else {
|
||||
return OxError(1);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user