Description
HybridFunction validates the fetched/cast NativeState pointers only under NITRO_DEBUG. In release builds, calling a HybridObject method after dispose() produces a null shared pointer and then invokes the member on null. Borrowing a method onto a different HybridObject type similarly dereferences a failed dynamic cast. JSI permits a present NativeState slot whose value is null after setNativeState(nullptr).
Expected behavior
The two post-fetch pointer guards should remain active in every build, producing the existing actionable JSI errors instead of undefined behavior.
Description
HybridFunctionvalidates the fetched/cast NativeState pointers only underNITRO_DEBUG. In release builds, calling a HybridObject method afterdispose()produces a null shared pointer and then invokes the member on null. Borrowing a method onto a different HybridObject type similarly dereferences a failed dynamic cast. JSI permits a present NativeState slot whose value is null aftersetNativeState(nullptr).Expected behavior
The two post-fetch pointer guards should remain active in every build, producing the existing actionable JSI errors instead of undefined behavior.