[Java] Properly convert strings to/from Modified UTF-8
[ldk-java] / src / main / java / org / ldk / structs / TwoTuple_OutPointScriptZ.java
index 1f65d4f209acb064928677341b3b160a10aba1fa..64df41c0b678bf2a9f6d46b5a0bd50257d8de19a 100644 (file)
@@ -28,7 +28,7 @@ public class TwoTuple_OutPointScriptZ extends CommonBase {
                Reference.reachabilityFence(this);
                if (ret >= 0 && ret <= 4096) { return null; }
                org.ldk.structs.OutPoint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OutPoint(null, ret); }
-               ret_hu_conv.ptrs_to.add(this);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
                return ret_hu_conv;
        }
 
@@ -56,20 +56,21 @@ public class TwoTuple_OutPointScriptZ extends CommonBase {
                Reference.reachabilityFence(this);
                if (ret >= 0 && ret <= 4096) { return null; }
                TwoTuple_OutPointScriptZ ret_hu_conv = new TwoTuple_OutPointScriptZ(null, ret);
-               ret_hu_conv.ptrs_to.add(this);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
                return ret_hu_conv;
        }
 
        /**
         * Creates a new C2Tuple_OutPointScriptZ from the contained elements.
         */
-       public static TwoTuple_OutPointScriptZ of(OutPoint a, byte[] b) {
-               long ret = bindings.C2Tuple_OutPointScriptZ_new(a == null ? 0 : a.ptr & ~1, b);
+       public static TwoTuple_OutPointScriptZ of(org.ldk.structs.OutPoint a, byte[] b) {
+               long ret = bindings.C2Tuple_OutPointScriptZ_new(a == null ? 0 : a.ptr, b);
                Reference.reachabilityFence(a);
                Reference.reachabilityFence(b);
                if (ret >= 0 && ret <= 4096) { return null; }
                TwoTuple_OutPointScriptZ ret_hu_conv = new TwoTuple_OutPointScriptZ(null, ret);
-               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(a); };
                return ret_hu_conv;
        }