Update to support None
[ldk-java] / src / main / java / org / ldk / structs / CommitmentSigned.java
index cb7870de4fa5ef80925a6fbc26f4b4a5cb837c6a..1a8b6aa7bb812bd912ef2882ddcc5fbb62be5222 100644 (file)
@@ -11,29 +11,29 @@ public class CommitmentSigned extends CommonBase {
        }
 
        public CommitmentSigned(CommitmentSigned orig) {
-               super(bindings.CommitmentSigned_clone(orig.ptr & ~1));
+               super(bindings.CommitmentSigned_clone(orig == null ? 0 : orig.ptr & ~1));
                this.ptrs_to.add(orig);
        }
 
        public byte[] get_channel_id(CommitmentSigned this_ptr) {
-               byte[] ret = bindings.CommitmentSigned_get_channel_id(this_ptr.ptr & ~1);
+               byte[] ret = bindings.CommitmentSigned_get_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1);
                this.ptrs_to.add(this_ptr);
                return ret;
        }
 
        public void set_channel_id(CommitmentSigned this_ptr, byte[] val) {
-               bindings.CommitmentSigned_set_channel_id(this_ptr.ptr & ~1, val);
+               bindings.CommitmentSigned_set_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
                this.ptrs_to.add(this_ptr);
        }
 
        public byte[] get_signature(CommitmentSigned this_ptr) {
-               byte[] ret = bindings.CommitmentSigned_get_signature(this_ptr.ptr & ~1);
+               byte[] ret = bindings.CommitmentSigned_get_signature(this_ptr == null ? 0 : this_ptr.ptr & ~1);
                this.ptrs_to.add(this_ptr);
                return ret;
        }
 
        public void set_signature(CommitmentSigned this_ptr, byte[] val) {
-               bindings.CommitmentSigned_set_signature(this_ptr.ptr & ~1, val);
+               bindings.CommitmentSigned_set_signature(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
                this.ptrs_to.add(this_ptr);
        }