Merge pull request #117 from TheBlueMatt/2022-08-fix-npe
[ldk-java] / src / main / java / org / ldk / structs / UnsignedChannelUpdate.java
index b22073917d76a97b84a9e19dc60c7ccd3b0ecdf0..b26042a90a5b675f88e67f258330b8864906d9a4 100644 (file)
@@ -196,6 +196,19 @@ public class UnsignedChannelUpdate extends CommonBase {
                Reference.reachabilityFence(val);
        }
 
+       /**
+        * Excess data which was signed as a part of the message which we do not (yet) understand how
+        * to decode. This is stored to ensure forward-compatibility as new fields are added to the
+        * lightning gossip
+        * 
+        * Returns a copy of the field.
+        */
+       public byte[] get_excess_data() {
+               byte[] ret = bindings.UnsignedChannelUpdate_get_excess_data(this.ptr);
+               Reference.reachabilityFence(this);
+               return ret;
+       }
+
        /**
         * Excess data which was signed as a part of the message which we do not (yet) understand how
         * to decode. This is stored to ensure forward-compatibility as new fields are added to the
@@ -224,7 +237,7 @@ public class UnsignedChannelUpdate extends CommonBase {
                Reference.reachabilityFence(excess_data_arg);
                if (ret >= 0 && ret <= 4096) { return null; }
                org.ldk.structs.UnsignedChannelUpdate ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.UnsignedChannelUpdate(null, ret); }
-               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
                return ret_hu_conv;
        }
 
@@ -242,7 +255,7 @@ public class UnsignedChannelUpdate extends CommonBase {
                Reference.reachabilityFence(this);
                if (ret >= 0 && ret <= 4096) { return null; }
                org.ldk.structs.UnsignedChannelUpdate ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.UnsignedChannelUpdate(null, ret); }
-               ret_hu_conv.ptrs_to.add(this);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
                return ret_hu_conv;
        }