mirror of
https://github.com/netbirdio/gomobile-tvos-fork.git
synced 2026-05-22 18:43:29 -07:00
mobile/bind: handle null references from Java in Go
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. Fixes golang/go#14228 Change-Id: I915d1f843c9db299d6910480f6d10dae0121a3b4 Reviewed-on: https://go-review.googlesource.com/19460 Reviewed-by: David Crawshaw <crawshaw@golang.org>
This commit is contained in:
committed by
David Crawshaw
parent
46f9e01d1e
commit
d1c2f486a3
Vendored
+3
-3
@@ -15,7 +15,7 @@ public abstract class Interfaces {
|
||||
_out = new go.Seq();
|
||||
int _result;
|
||||
_in = new go.Seq();
|
||||
_in.writeRef(r.ref());
|
||||
_in.writeRef(r != null ? r.ref() : null);
|
||||
Seq.send(DESCRIPTOR, CALL_Add3, _in, _out);
|
||||
_result = _out.readInt32();
|
||||
return _result;
|
||||
@@ -26,7 +26,7 @@ public abstract class Interfaces {
|
||||
go.Seq _out = null;
|
||||
_out = new go.Seq();
|
||||
_in = new go.Seq();
|
||||
_in.writeRef(e.ref());
|
||||
_in.writeRef(e != null ? e.ref() : null);
|
||||
Seq.send(DESCRIPTOR, CALL_CallErr, _in, _out);
|
||||
String _err = _out.readString();
|
||||
if (_err != null && !_err.isEmpty()) {
|
||||
@@ -222,7 +222,7 @@ public abstract class Interfaces {
|
||||
switch (code) {
|
||||
case Proxy.CALL_F: {
|
||||
I1 result = this.F();
|
||||
out.writeRef(result.ref());
|
||||
out.writeRef(result != null ? result.ref() : null);
|
||||
return;
|
||||
}
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user