Update to support None
[ldk-java] / src / main / java / org / ldk / structs / Pong.java
index fc98b396ae2abd8228c64e706de3cf1e0df9da5b..0ddec80cf976e41887b64b32950f3fd981738e9f 100644 (file)
@@ -11,18 +11,18 @@ public class Pong extends CommonBase {
        }
 
        public Pong(Pong orig) {
-               super(bindings.Pong_clone(orig.ptr & ~1));
+               super(bindings.Pong_clone(orig == null ? 0 : orig.ptr & ~1));
                this.ptrs_to.add(orig);
        }
 
        public short get_byteslen(Pong this_ptr) {
-               short ret = bindings.Pong_get_byteslen(this_ptr.ptr & ~1);
+               short ret = bindings.Pong_get_byteslen(this_ptr == null ? 0 : this_ptr.ptr & ~1);
                this.ptrs_to.add(this_ptr);
                return ret;
        }
 
        public void set_byteslen(Pong this_ptr, short val) {
-               bindings.Pong_set_byteslen(this_ptr.ptr & ~1, val);
+               bindings.Pong_set_byteslen(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
                this.ptrs_to.add(this_ptr);
        }