Update to support None
[ldk-java] / src / main / java / org / ldk / structs / ChannelReestablish.java
index ee92dc0f266b20cfe84b669032cd453017e97ea0..476c924518f351ec413894dcc732e6ed7420dbd9 100644 (file)
@@ -11,40 +11,40 @@ public class ChannelReestablish extends CommonBase {
        }
 
        public ChannelReestablish(ChannelReestablish orig) {
-               super(bindings.ChannelReestablish_clone(orig.ptr & ~1));
+               super(bindings.ChannelReestablish_clone(orig == null ? 0 : orig.ptr & ~1));
                this.ptrs_to.add(orig);
        }
 
        public byte[] get_channel_id(ChannelReestablish this_ptr) {
-               byte[] ret = bindings.ChannelReestablish_get_channel_id(this_ptr.ptr & ~1);
+               byte[] ret = bindings.ChannelReestablish_get_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1);
                this.ptrs_to.add(this_ptr);
                return ret;
        }
 
        public void set_channel_id(ChannelReestablish this_ptr, byte[] val) {
-               bindings.ChannelReestablish_set_channel_id(this_ptr.ptr & ~1, val);
+               bindings.ChannelReestablish_set_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
                this.ptrs_to.add(this_ptr);
        }
 
        public long get_next_local_commitment_number(ChannelReestablish this_ptr) {
-               long ret = bindings.ChannelReestablish_get_next_local_commitment_number(this_ptr.ptr & ~1);
+               long ret = bindings.ChannelReestablish_get_next_local_commitment_number(this_ptr == null ? 0 : this_ptr.ptr & ~1);
                this.ptrs_to.add(this_ptr);
                return ret;
        }
 
        public void set_next_local_commitment_number(ChannelReestablish this_ptr, long val) {
-               bindings.ChannelReestablish_set_next_local_commitment_number(this_ptr.ptr & ~1, val);
+               bindings.ChannelReestablish_set_next_local_commitment_number(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
                this.ptrs_to.add(this_ptr);
        }
 
        public long get_next_remote_commitment_number(ChannelReestablish this_ptr) {
-               long ret = bindings.ChannelReestablish_get_next_remote_commitment_number(this_ptr.ptr & ~1);
+               long ret = bindings.ChannelReestablish_get_next_remote_commitment_number(this_ptr == null ? 0 : this_ptr.ptr & ~1);
                this.ptrs_to.add(this_ptr);
                return ret;
        }
 
        public void set_next_remote_commitment_number(ChannelReestablish this_ptr, long val) {
-               bindings.ChannelReestablish_set_next_remote_commitment_number(this_ptr.ptr & ~1, val);
+               bindings.ChannelReestablish_set_next_remote_commitment_number(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
                this.ptrs_to.add(this_ptr);
        }