You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
gobind should support java null pointers and consider them to nil interfaces instead of crashing. I've attached a simple change to the bind example to demonstrate this issue. Compiling and running it results in the following exception:
02-04 16:15:11.008 11339 11339 E AndroidRuntime: Caused by: java.lang.NullPointerException: Attempt to invoke interface method 'go.Seq$Ref go.hello.Hello$Interface.ref()' on a null object reference
02-04 16:15:11.008 11339 11339 E AndroidRuntime: at go.hello.Hello.InterfaceTest(Hello.java:85)
02-04 16:15:11.008 11339 11339 E AndroidRuntime: at org.golang.example.bind.MainActivity.onCreate(MainActivity.java:27)
02-04 16:15:11.008 11339 11339 E AndroidRuntime: at android.app.Activity.performCreate(Activity.java:6251)
02-04 16:15:11.008 11339 11339 E AndroidRuntime: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
02-04 16:15:11.008 11339 11339 E AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
02-04 16:15:11.008 11339 11339 E AndroidRuntime: ... 9 more
The Seq Java class has a special case for null references. Expand
the special case to Go so that null references from Java are properly
translated to nil.
Fixesgolang/go#14228
Change-Id: I915d1f843c9db299d6910480f6d10dae0121a3b4
Reviewed-on: https://go-review.googlesource.com/19460
Reviewed-by: David Crawshaw <crawshaw@golang.org>
imWildCat
pushed a commit
to imWildCat/go-mobile
that referenced
this issue
Apr 11, 2021
The Seq Java class has a special case for null references. Expand
the special case to Go so that null references from Java are properly
translated to nil.
Fixesgolang/go#14228
Change-Id: I915d1f843c9db299d6910480f6d10dae0121a3b4
Reviewed-on: https://go-review.googlesource.com/19460
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
gobind should support java null pointers and consider them to nil interfaces instead of crashing. I've attached a simple change to the bind example to demonstrate this issue. Compiling and running it results in the following exception:
02-04 16:15:11.008 11339 11339 E AndroidRuntime: Caused by: java.lang.NullPointerException: Attempt to invoke interface method 'go.Seq$Ref go.hello.Hello$Interface.ref()' on a null object reference
02-04 16:15:11.008 11339 11339 E AndroidRuntime: at go.hello.Hello.InterfaceTest(Hello.java:85)
02-04 16:15:11.008 11339 11339 E AndroidRuntime: at org.golang.example.bind.MainActivity.onCreate(MainActivity.java:27)
02-04 16:15:11.008 11339 11339 E AndroidRuntime: at android.app.Activity.performCreate(Activity.java:6251)
02-04 16:15:11.008 11339 11339 E AndroidRuntime: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
02-04 16:15:11.008 11339 11339 E AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
02-04 16:15:11.008 11339 11339 E AndroidRuntime: ... 9 more
niltest.txt
The text was updated successfully, but these errors were encountered: