Update to support None
[ldk-java] / src / main / java / org / ldk / structs / Ping.java
index fed9c3433cc1f71a56ca4383502f9e877cd4ff40..e0e1b3d541ac1cddaf789d5a36d77c699540a9eb 100644 (file)
@@ -11,29 +11,29 @@ public class Ping extends CommonBase {
        }
 
        public Ping(Ping orig) {
-               super(bindings.Ping_clone(orig.ptr & ~1));
+               super(bindings.Ping_clone(orig == null ? 0 : orig.ptr & ~1));
                this.ptrs_to.add(orig);
        }
 
        public short get_ponglen(Ping this_ptr) {
-               short ret = bindings.Ping_get_ponglen(this_ptr.ptr & ~1);
+               short ret = bindings.Ping_get_ponglen(this_ptr == null ? 0 : this_ptr.ptr & ~1);
                this.ptrs_to.add(this_ptr);
                return ret;
        }
 
        public void set_ponglen(Ping this_ptr, short val) {
-               bindings.Ping_set_ponglen(this_ptr.ptr & ~1, val);
+               bindings.Ping_set_ponglen(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
                this.ptrs_to.add(this_ptr);
        }
 
        public short get_byteslen(Ping this_ptr) {
-               short ret = bindings.Ping_get_byteslen(this_ptr.ptr & ~1);
+               short ret = bindings.Ping_get_byteslen(this_ptr == null ? 0 : this_ptr.ptr & ~1);
                this.ptrs_to.add(this_ptr);
                return ret;
        }
 
        public void set_byteslen(Ping this_ptr, short val) {
-               bindings.Ping_set_byteslen(this_ptr.ptr & ~1, val);
+               bindings.Ping_set_byteslen(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
                this.ptrs_to.add(this_ptr);
        }