Search Issue Tracker
Fixed in 5.6.0
Votes
2
Found in
5.3.6p6
Issue ID
839005
Regression
No
AndroidJavaObject.Call<>() throws exception instead of returning null pointer
Reproduction steps:
1. Open the attached project ("839005 - ReproProject.zip")
2. Build and run on Android device
3. Check device logcat
Actual result: "Exception: JNI: Init'd AndroidJavaObject with null ptr!" is thrown
Expected result: "Exception: JNI: Init'd AndroidJavaObject with null ptr!" shouldn't be thrown
Reproduced on:
5.2.3p3, 5.3.7p4, 5.4.4p3, 5.5.1p4, 5.6.0b9
DUT:
Meizu MX5 with Android 5.0.1
Samsung Galaxy S7 (SM-G930F) with Android 6.0.1
Fixed in: 2017.1.0a5
Backported to: 5.6.0p3, 5.5.3p3
Comments (1)
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Modifying UI Prefab child's Height only confirms the first 1 or 2 digits when the Scene is newly opened or the Prefab is newly created
- ProfilingSampler.Get() returns null and makes the Player only render black when building a Release Build
- Search text field visual controls for the Path binding in an Input Actions Asset is misaligned
- Display issues in VideoPlayer when using Screen.SetResolution on certain Google Pixel devices
- Crash on Texture::TextureIDMapInsert when opening a specific project
vitaliy-zasadnyy
Feb 21, 2017 10:42
Exceptions are not the best for flow control. From my point of view it's better to return AndroidJavaObject that satisfies conditions:
public static bool IsJavaNull(this AndroidJavaObject ajo)
{
return ajo == null || ajo.GetRawObject().ToInt32() == 0;
}