Update to support None
[ldk-java] / src / main / java / org / ldk / structs / ErrorMessage.java
index 1ca776f5f7024f86ad896730d7fcfd09a9730715..b63931d68a0c82e47a9da5235ac74d21009aa4b4 100644 (file)
@@ -11,18 +11,18 @@ public class ErrorMessage extends CommonBase {
        }
 
        public ErrorMessage(ErrorMessage orig) {
-               super(bindings.ErrorMessage_clone(orig.ptr & ~1));
+               super(bindings.ErrorMessage_clone(orig == null ? 0 : orig.ptr & ~1));
                this.ptrs_to.add(orig);
        }
 
        public byte[] get_channel_id(ErrorMessage this_ptr) {
-               byte[] ret = bindings.ErrorMessage_get_channel_id(this_ptr.ptr & ~1);
+               byte[] ret = bindings.ErrorMessage_get_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1);
                this.ptrs_to.add(this_ptr);
                return ret;
        }
 
        public void set_channel_id(ErrorMessage this_ptr, byte[] val) {
-               bindings.ErrorMessage_set_channel_id(this_ptr.ptr & ~1, val);
+               bindings.ErrorMessage_set_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
                this.ptrs_to.add(this_ptr);
        }