Update to support None
[ldk-java] / src / main / java / org / ldk / structs / UpdateFailHTLC.java
index edc4e8ccf0a16b0bed265528ec4ac4e7e8913019..b1cb03290b8e7952b4a66ba17133e25b54f0b6b7 100644 (file)
@@ -11,29 +11,29 @@ public class UpdateFailHTLC extends CommonBase {
        }
 
        public UpdateFailHTLC(UpdateFailHTLC orig) {
-               super(bindings.UpdateFailHTLC_clone(orig.ptr & ~1));
+               super(bindings.UpdateFailHTLC_clone(orig == null ? 0 : orig.ptr & ~1));
                this.ptrs_to.add(orig);
        }
 
        public byte[] get_channel_id(UpdateFailHTLC this_ptr) {
-               byte[] ret = bindings.UpdateFailHTLC_get_channel_id(this_ptr.ptr & ~1);
+               byte[] ret = bindings.UpdateFailHTLC_get_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1);
                this.ptrs_to.add(this_ptr);
                return ret;
        }
 
        public void set_channel_id(UpdateFailHTLC this_ptr, byte[] val) {
-               bindings.UpdateFailHTLC_set_channel_id(this_ptr.ptr & ~1, val);
+               bindings.UpdateFailHTLC_set_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
                this.ptrs_to.add(this_ptr);
        }
 
        public long get_htlc_id(UpdateFailHTLC this_ptr) {
-               long ret = bindings.UpdateFailHTLC_get_htlc_id(this_ptr.ptr & ~1);
+               long ret = bindings.UpdateFailHTLC_get_htlc_id(this_ptr == null ? 0 : this_ptr.ptr & ~1);
                this.ptrs_to.add(this_ptr);
                return ret;
        }
 
        public void set_htlc_id(UpdateFailHTLC this_ptr, long val) {
-               bindings.UpdateFailHTLC_set_htlc_id(this_ptr.ptr & ~1, val);
+               bindings.UpdateFailHTLC_set_htlc_id(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
                this.ptrs_to.add(this_ptr);
        }