File tree Expand file tree Collapse file tree 3 files changed +16
-0
lines changed
Expand file tree Collapse file tree 3 files changed +16
-0
lines changed Original file line number Diff line number Diff line change 44 through method channels. You can send the address of the pointer as ` long ` and
55 reconstruct the class using the helper method.
66- Fixed a bug where it would be possible for a type class inference to fail.
7+ - Return 'null' when calling ` toString ` on a null object.
78
89## 0.12.0
910
Original file line number Diff line number Diff line change @@ -127,6 +127,9 @@ class JObject {
127127 _class.instanceMethodId (r'toString' , r'()Ljava/lang/String;' );
128128 @override
129129 String toString () {
130+ if (reference.isNull) {
131+ return 'null' ;
132+ }
130133 return _toStringId (this , const JStringType (), [])
131134 .toDartString (releaseOriginal: true );
132135 }
Original file line number Diff line number Diff line change @@ -296,4 +296,16 @@ void run({required TestRunnerCallback testRunner}) {
296296 throwsA (isA <AssertionError >()),
297297 );
298298 });
299+
300+ testRunner ('toString' , () {
301+ final long = JLong (1 );
302+ expect (
303+ long.toString (),
304+ '1' ,
305+ );
306+ expect (
307+ JLong .fromReference (jNullReference).toString (),
308+ 'null' ,
309+ );
310+ });
299311}
You can’t perform that action at this time.
0 commit comments