Update to support None
[ldk-java] / src / main / java / org / ldk / structs / RevokeAndACK.java
index 514ded4babd564fb71f690b0d878dedd89aacc33..d887797c49d8fea0c1392219fd940425dd3aeba5 100644 (file)
@@ -11,40 +11,40 @@ public class RevokeAndACK extends CommonBase {
        }
 
        public RevokeAndACK(RevokeAndACK orig) {
-               super(bindings.RevokeAndACK_clone(orig.ptr & ~1));
+               super(bindings.RevokeAndACK_clone(orig == null ? 0 : orig.ptr & ~1));
                this.ptrs_to.add(orig);
        }
 
        public byte[] get_channel_id(RevokeAndACK this_ptr) {
-               byte[] ret = bindings.RevokeAndACK_get_channel_id(this_ptr.ptr & ~1);
+               byte[] ret = bindings.RevokeAndACK_get_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1);
                this.ptrs_to.add(this_ptr);
                return ret;
        }
 
        public void set_channel_id(RevokeAndACK this_ptr, byte[] val) {
-               bindings.RevokeAndACK_set_channel_id(this_ptr.ptr & ~1, val);
+               bindings.RevokeAndACK_set_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
                this.ptrs_to.add(this_ptr);
        }
 
        public byte[] get_per_commitment_secret(RevokeAndACK this_ptr) {
-               byte[] ret = bindings.RevokeAndACK_get_per_commitment_secret(this_ptr.ptr & ~1);
+               byte[] ret = bindings.RevokeAndACK_get_per_commitment_secret(this_ptr == null ? 0 : this_ptr.ptr & ~1);
                this.ptrs_to.add(this_ptr);
                return ret;
        }
 
        public void set_per_commitment_secret(RevokeAndACK this_ptr, byte[] val) {
-               bindings.RevokeAndACK_set_per_commitment_secret(this_ptr.ptr & ~1, val);
+               bindings.RevokeAndACK_set_per_commitment_secret(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
                this.ptrs_to.add(this_ptr);
        }
 
        public byte[] get_next_per_commitment_point(RevokeAndACK this_ptr) {
-               byte[] ret = bindings.RevokeAndACK_get_next_per_commitment_point(this_ptr.ptr & ~1);
+               byte[] ret = bindings.RevokeAndACK_get_next_per_commitment_point(this_ptr == null ? 0 : this_ptr.ptr & ~1);
                this.ptrs_to.add(this_ptr);
                return ret;
        }
 
        public void set_next_per_commitment_point(RevokeAndACK this_ptr, byte[] val) {
-               bindings.RevokeAndACK_set_next_per_commitment_point(this_ptr.ptr & ~1, val);
+               bindings.RevokeAndACK_set_next_per_commitment_point(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
                this.ptrs_to.add(this_ptr);
        }