Update to support None
[ldk-java] / src / main / java / org / ldk / structs / ChannelHandshakeConfig.java
index a01e2a57201bd71090a63d6fc40746100c4fe804..f8cea8fd91409ef0c43133ebf3ddbabba61ca154 100644 (file)
@@ -11,40 +11,40 @@ public class ChannelHandshakeConfig extends CommonBase {
        }
 
        public ChannelHandshakeConfig(ChannelHandshakeConfig orig) {
-               super(bindings.ChannelHandshakeConfig_clone(orig.ptr & ~1));
+               super(bindings.ChannelHandshakeConfig_clone(orig == null ? 0 : orig.ptr & ~1));
                this.ptrs_to.add(orig);
        }
 
        public int get_minimum_depth(ChannelHandshakeConfig this_ptr) {
-               int ret = bindings.ChannelHandshakeConfig_get_minimum_depth(this_ptr.ptr & ~1);
+               int ret = bindings.ChannelHandshakeConfig_get_minimum_depth(this_ptr == null ? 0 : this_ptr.ptr & ~1);
                this.ptrs_to.add(this_ptr);
                return ret;
        }
 
        public void set_minimum_depth(ChannelHandshakeConfig this_ptr, int val) {
-               bindings.ChannelHandshakeConfig_set_minimum_depth(this_ptr.ptr & ~1, val);
+               bindings.ChannelHandshakeConfig_set_minimum_depth(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
                this.ptrs_to.add(this_ptr);
        }
 
        public short get_our_to_self_delay(ChannelHandshakeConfig this_ptr) {
-               short ret = bindings.ChannelHandshakeConfig_get_our_to_self_delay(this_ptr.ptr & ~1);
+               short ret = bindings.ChannelHandshakeConfig_get_our_to_self_delay(this_ptr == null ? 0 : this_ptr.ptr & ~1);
                this.ptrs_to.add(this_ptr);
                return ret;
        }
 
        public void set_our_to_self_delay(ChannelHandshakeConfig this_ptr, short val) {
-               bindings.ChannelHandshakeConfig_set_our_to_self_delay(this_ptr.ptr & ~1, val);
+               bindings.ChannelHandshakeConfig_set_our_to_self_delay(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
                this.ptrs_to.add(this_ptr);
        }
 
        public long get_our_htlc_minimum_msat(ChannelHandshakeConfig this_ptr) {
-               long ret = bindings.ChannelHandshakeConfig_get_our_htlc_minimum_msat(this_ptr.ptr & ~1);
+               long ret = bindings.ChannelHandshakeConfig_get_our_htlc_minimum_msat(this_ptr == null ? 0 : this_ptr.ptr & ~1);
                this.ptrs_to.add(this_ptr);
                return ret;
        }
 
        public void set_our_htlc_minimum_msat(ChannelHandshakeConfig this_ptr, long val) {
-               bindings.ChannelHandshakeConfig_set_our_htlc_minimum_msat(this_ptr.ptr & ~1, val);
+               bindings.ChannelHandshakeConfig_set_our_htlc_minimum_msat(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
                this.ptrs_to.add(this_ptr);
        }