Update to support None
[ldk-java] / src / main / java / org / ldk / structs / QueryChannelRange.java
index 70491a4d811cabde069bbb0136e1bf59c30a2a3a..c1a8b3f2ca970a5cafa05bf97034d90d750fde79 100644 (file)
@@ -11,40 +11,40 @@ public class QueryChannelRange extends CommonBase {
        }
 
        public QueryChannelRange(QueryChannelRange orig) {
-               super(bindings.QueryChannelRange_clone(orig.ptr & ~1));
+               super(bindings.QueryChannelRange_clone(orig == null ? 0 : orig.ptr & ~1));
                this.ptrs_to.add(orig);
        }
 
        public byte[] get_chain_hash(QueryChannelRange this_ptr) {
-               byte[] ret = bindings.QueryChannelRange_get_chain_hash(this_ptr.ptr & ~1);
+               byte[] ret = bindings.QueryChannelRange_get_chain_hash(this_ptr == null ? 0 : this_ptr.ptr & ~1);
                this.ptrs_to.add(this_ptr);
                return ret;
        }
 
        public void set_chain_hash(QueryChannelRange this_ptr, byte[] val) {
-               bindings.QueryChannelRange_set_chain_hash(this_ptr.ptr & ~1, val);
+               bindings.QueryChannelRange_set_chain_hash(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
                this.ptrs_to.add(this_ptr);
        }
 
        public int get_first_blocknum(QueryChannelRange this_ptr) {
-               int ret = bindings.QueryChannelRange_get_first_blocknum(this_ptr.ptr & ~1);
+               int ret = bindings.QueryChannelRange_get_first_blocknum(this_ptr == null ? 0 : this_ptr.ptr & ~1);
                this.ptrs_to.add(this_ptr);
                return ret;
        }
 
        public void set_first_blocknum(QueryChannelRange this_ptr, int val) {
-               bindings.QueryChannelRange_set_first_blocknum(this_ptr.ptr & ~1, val);
+               bindings.QueryChannelRange_set_first_blocknum(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
                this.ptrs_to.add(this_ptr);
        }
 
        public int get_number_of_blocks(QueryChannelRange this_ptr) {
-               int ret = bindings.QueryChannelRange_get_number_of_blocks(this_ptr.ptr & ~1);
+               int ret = bindings.QueryChannelRange_get_number_of_blocks(this_ptr == null ? 0 : this_ptr.ptr & ~1);
                this.ptrs_to.add(this_ptr);
                return ret;
        }
 
        public void set_number_of_blocks(QueryChannelRange this_ptr, int val) {
-               bindings.QueryChannelRange_set_number_of_blocks(this_ptr.ptr & ~1, val);
+               bindings.QueryChannelRange_set_number_of_blocks(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
                this.ptrs_to.add(this_ptr);
        }