Update to support None
[ldk-java] / src / main / java / org / ldk / structs / Shutdown.java
index 09f1d36f208bcc661777987ab65a7b268f1dd115..8c690a9d3aba4379622f9a5e9fbd25dc428d1903 100644 (file)
@@ -11,23 +11,23 @@ public class Shutdown extends CommonBase {
        }
 
        public Shutdown(Shutdown orig) {
-               super(bindings.Shutdown_clone(orig.ptr & ~1));
+               super(bindings.Shutdown_clone(orig == null ? 0 : orig.ptr & ~1));
                this.ptrs_to.add(orig);
        }
 
        public byte[] get_channel_id(Shutdown this_ptr) {
-               byte[] ret = bindings.Shutdown_get_channel_id(this_ptr.ptr & ~1);
+               byte[] ret = bindings.Shutdown_get_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1);
                this.ptrs_to.add(this_ptr);
                return ret;
        }
 
        public void set_channel_id(Shutdown this_ptr, byte[] val) {
-               bindings.Shutdown_set_channel_id(this_ptr.ptr & ~1, val);
+               bindings.Shutdown_set_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
                this.ptrs_to.add(this_ptr);
        }
 
        public byte[] get_scriptpubkey(Shutdown this_ptr) {
-               byte[] ret = bindings.Shutdown_get_scriptpubkey(this_ptr.ptr & ~1);
+               byte[] ret = bindings.Shutdown_get_scriptpubkey(this_ptr == null ? 0 : this_ptr.ptr & ~1);
                this.ptrs_to.add(this_ptr);
                return ret;
        }