[Java] Handle nullable arrays
[ldk-java] / src / main / java / org / ldk / structs / Retry.java
index 2f2b4d8fc85bffdebd80abe90b6154752917e206..dc1274e9c8165d99ef095f13d26a316635264a66 100644 (file)
@@ -68,7 +68,7 @@ public class Retry extends CommonBase {
                Reference.reachabilityFence(this);
                if (ret >= 0 && ret <= 4096) { return null; }
                org.ldk.structs.Retry ret_hu_conv = org.ldk.structs.Retry.constr_from_ptr(ret);
-               ret_hu_conv.ptrs_to.add(this);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
                return ret_hu_conv;
        }
 
@@ -80,7 +80,7 @@ public class Retry extends CommonBase {
                Reference.reachabilityFence(a);
                if (ret >= 0 && ret <= 4096) { return null; }
                org.ldk.structs.Retry ret_hu_conv = org.ldk.structs.Retry.constr_from_ptr(ret);
-               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
                return ret_hu_conv;
        }
 
@@ -92,7 +92,7 @@ public class Retry extends CommonBase {
                Reference.reachabilityFence(a);
                if (ret >= 0 && ret <= 4096) { return null; }
                org.ldk.structs.Retry ret_hu_conv = org.ldk.structs.Retry.constr_from_ptr(ret);
-               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
                return ret_hu_conv;
        }
 
@@ -101,7 +101,7 @@ public class Retry extends CommonBase {
         * This ignores pointers and is_owned flags and looks at the values in fields.
         */
        public boolean eq(Retry b) {
-               boolean ret = bindings.Retry_eq(this.ptr, b == null ? 0 : b.ptr & ~1);
+               boolean ret = bindings.Retry_eq(this.ptr, b == null ? 0 : b.ptr);
                Reference.reachabilityFence(this);
                Reference.reachabilityFence(b);
                return ret;