Update to support None
[ldk-java] / src / main / java / org / ldk / structs / FundingLocked.java
index b330b6505f9ce9deb7c897b313ed697e87d84dfe..1cd857e7ca468c08fa312f850086195a67d43c5b 100644 (file)
@@ -11,29 +11,29 @@ public class FundingLocked extends CommonBase {
        }
 
        public FundingLocked(FundingLocked orig) {
-               super(bindings.FundingLocked_clone(orig.ptr & ~1));
+               super(bindings.FundingLocked_clone(orig == null ? 0 : orig.ptr & ~1));
                this.ptrs_to.add(orig);
        }
 
        public byte[] get_channel_id(FundingLocked this_ptr) {
-               byte[] ret = bindings.FundingLocked_get_channel_id(this_ptr.ptr & ~1);
+               byte[] ret = bindings.FundingLocked_get_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1);
                this.ptrs_to.add(this_ptr);
                return ret;
        }
 
        public void set_channel_id(FundingLocked this_ptr, byte[] val) {
-               bindings.FundingLocked_set_channel_id(this_ptr.ptr & ~1, val);
+               bindings.FundingLocked_set_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
                this.ptrs_to.add(this_ptr);
        }
 
        public byte[] get_next_per_commitment_point(FundingLocked this_ptr) {
-               byte[] ret = bindings.FundingLocked_get_next_per_commitment_point(this_ptr.ptr & ~1);
+               byte[] ret = bindings.FundingLocked_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(FundingLocked this_ptr, byte[] val) {
-               bindings.FundingLocked_set_next_per_commitment_point(this_ptr.ptr & ~1, val);
+               bindings.FundingLocked_set_next_per_commitment_point(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
                this.ptrs_to.add(this_ptr);
        }