Update to support None
[ldk-java] / src / main / java / org / ldk / structs / ChannelPublicKeys.java
index edabb75b7bde8bf553e20b5007f423a8228191be..45fbc7d8052601262d03ef294495487b528f5808 100644 (file)
@@ -11,62 +11,62 @@ public class ChannelPublicKeys extends CommonBase {
        }
 
        public ChannelPublicKeys(ChannelPublicKeys orig) {
-               super(bindings.ChannelPublicKeys_clone(orig.ptr & ~1));
+               super(bindings.ChannelPublicKeys_clone(orig == null ? 0 : orig.ptr & ~1));
                this.ptrs_to.add(orig);
        }
 
        public byte[] get_funding_pubkey(ChannelPublicKeys this_ptr) {
-               byte[] ret = bindings.ChannelPublicKeys_get_funding_pubkey(this_ptr.ptr & ~1);
+               byte[] ret = bindings.ChannelPublicKeys_get_funding_pubkey(this_ptr == null ? 0 : this_ptr.ptr & ~1);
                this.ptrs_to.add(this_ptr);
                return ret;
        }
 
        public void set_funding_pubkey(ChannelPublicKeys this_ptr, byte[] val) {
-               bindings.ChannelPublicKeys_set_funding_pubkey(this_ptr.ptr & ~1, val);
+               bindings.ChannelPublicKeys_set_funding_pubkey(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
                this.ptrs_to.add(this_ptr);
        }
 
        public byte[] get_revocation_basepoint(ChannelPublicKeys this_ptr) {
-               byte[] ret = bindings.ChannelPublicKeys_get_revocation_basepoint(this_ptr.ptr & ~1);
+               byte[] ret = bindings.ChannelPublicKeys_get_revocation_basepoint(this_ptr == null ? 0 : this_ptr.ptr & ~1);
                this.ptrs_to.add(this_ptr);
                return ret;
        }
 
        public void set_revocation_basepoint(ChannelPublicKeys this_ptr, byte[] val) {
-               bindings.ChannelPublicKeys_set_revocation_basepoint(this_ptr.ptr & ~1, val);
+               bindings.ChannelPublicKeys_set_revocation_basepoint(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
                this.ptrs_to.add(this_ptr);
        }
 
        public byte[] get_payment_point(ChannelPublicKeys this_ptr) {
-               byte[] ret = bindings.ChannelPublicKeys_get_payment_point(this_ptr.ptr & ~1);
+               byte[] ret = bindings.ChannelPublicKeys_get_payment_point(this_ptr == null ? 0 : this_ptr.ptr & ~1);
                this.ptrs_to.add(this_ptr);
                return ret;
        }
 
        public void set_payment_point(ChannelPublicKeys this_ptr, byte[] val) {
-               bindings.ChannelPublicKeys_set_payment_point(this_ptr.ptr & ~1, val);
+               bindings.ChannelPublicKeys_set_payment_point(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
                this.ptrs_to.add(this_ptr);
        }
 
        public byte[] get_delayed_payment_basepoint(ChannelPublicKeys this_ptr) {
-               byte[] ret = bindings.ChannelPublicKeys_get_delayed_payment_basepoint(this_ptr.ptr & ~1);
+               byte[] ret = bindings.ChannelPublicKeys_get_delayed_payment_basepoint(this_ptr == null ? 0 : this_ptr.ptr & ~1);
                this.ptrs_to.add(this_ptr);
                return ret;
        }
 
        public void set_delayed_payment_basepoint(ChannelPublicKeys this_ptr, byte[] val) {
-               bindings.ChannelPublicKeys_set_delayed_payment_basepoint(this_ptr.ptr & ~1, val);
+               bindings.ChannelPublicKeys_set_delayed_payment_basepoint(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
                this.ptrs_to.add(this_ptr);
        }
 
        public byte[] get_htlc_basepoint(ChannelPublicKeys this_ptr) {
-               byte[] ret = bindings.ChannelPublicKeys_get_htlc_basepoint(this_ptr.ptr & ~1);
+               byte[] ret = bindings.ChannelPublicKeys_get_htlc_basepoint(this_ptr == null ? 0 : this_ptr.ptr & ~1);
                this.ptrs_to.add(this_ptr);
                return ret;
        }
 
        public void set_htlc_basepoint(ChannelPublicKeys this_ptr, byte[] val) {
-               bindings.ChannelPublicKeys_set_htlc_basepoint(this_ptr.ptr & ~1, val);
+               bindings.ChannelPublicKeys_set_htlc_basepoint(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
                this.ptrs_to.add(this_ptr);
        }