Update to support None
[ldk-java] / src / main / java / org / ldk / structs / UpdateFailMalformedHTLC.java
index 209cd0cc8fac6262d6bd85f2ecd2802b387be38a..8f414a988fe0f31bc03b05e775f2a7674ff7b498 100644 (file)
@@ -11,40 +11,40 @@ public class UpdateFailMalformedHTLC extends CommonBase {
        }
 
        public UpdateFailMalformedHTLC(UpdateFailMalformedHTLC orig) {
-               super(bindings.UpdateFailMalformedHTLC_clone(orig.ptr & ~1));
+               super(bindings.UpdateFailMalformedHTLC_clone(orig == null ? 0 : orig.ptr & ~1));
                this.ptrs_to.add(orig);
        }
 
        public byte[] get_channel_id(UpdateFailMalformedHTLC this_ptr) {
-               byte[] ret = bindings.UpdateFailMalformedHTLC_get_channel_id(this_ptr.ptr & ~1);
+               byte[] ret = bindings.UpdateFailMalformedHTLC_get_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1);
                this.ptrs_to.add(this_ptr);
                return ret;
        }
 
        public void set_channel_id(UpdateFailMalformedHTLC this_ptr, byte[] val) {
-               bindings.UpdateFailMalformedHTLC_set_channel_id(this_ptr.ptr & ~1, val);
+               bindings.UpdateFailMalformedHTLC_set_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
                this.ptrs_to.add(this_ptr);
        }
 
        public long get_htlc_id(UpdateFailMalformedHTLC this_ptr) {
-               long ret = bindings.UpdateFailMalformedHTLC_get_htlc_id(this_ptr.ptr & ~1);
+               long ret = bindings.UpdateFailMalformedHTLC_get_htlc_id(this_ptr == null ? 0 : this_ptr.ptr & ~1);
                this.ptrs_to.add(this_ptr);
                return ret;
        }
 
        public void set_htlc_id(UpdateFailMalformedHTLC this_ptr, long val) {
-               bindings.UpdateFailMalformedHTLC_set_htlc_id(this_ptr.ptr & ~1, val);
+               bindings.UpdateFailMalformedHTLC_set_htlc_id(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
                this.ptrs_to.add(this_ptr);
        }
 
        public short get_failure_code(UpdateFailMalformedHTLC this_ptr) {
-               short ret = bindings.UpdateFailMalformedHTLC_get_failure_code(this_ptr.ptr & ~1);
+               short ret = bindings.UpdateFailMalformedHTLC_get_failure_code(this_ptr == null ? 0 : this_ptr.ptr & ~1);
                this.ptrs_to.add(this_ptr);
                return ret;
        }
 
        public void set_failure_code(UpdateFailMalformedHTLC this_ptr, short val) {
-               bindings.UpdateFailMalformedHTLC_set_failure_code(this_ptr.ptr & ~1, val);
+               bindings.UpdateFailMalformedHTLC_set_failure_code(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
                this.ptrs_to.add(this_ptr);
        }