Merge pull request #126 from TheBlueMatt/main
[ldk-java] / src / main / java / org / ldk / structs / Result_PaymentSecretAPIErrorZ.java
index acb6d201ccb01d1c65c16d750bca6763072ba431..d9919679dadab499ec4a813e86bcb099d0d2f904 100644 (file)
@@ -33,8 +33,8 @@ public class Result_PaymentSecretAPIErrorZ extends CommonBase {
                private Result_PaymentSecretAPIErrorZ_Err(Object _dummy, long ptr) {
                        super(_dummy, ptr);
                        long err = bindings.CResult_PaymentSecretAPIErrorZ_get_err(ptr);
-                       APIError err_hu_conv = APIError.constr_from_ptr(err);
-                       err_hu_conv.ptrs_to.add(this);
+                       org.ldk.structs.APIError err_hu_conv = org.ldk.structs.APIError.constr_from_ptr(err);
+                       if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
                        this.err = err_hu_conv;
                }
        }
@@ -53,11 +53,12 @@ public class Result_PaymentSecretAPIErrorZ extends CommonBase {
        /**
         * Creates a new CResult_PaymentSecretAPIErrorZ in the error state.
         */
-       public static Result_PaymentSecretAPIErrorZ err(APIError e) {
+       public static Result_PaymentSecretAPIErrorZ err(org.ldk.structs.APIError e) {
                long ret = bindings.CResult_PaymentSecretAPIErrorZ_err(e.ptr);
                Reference.reachabilityFence(e);
                if (ret >= 0 && ret <= 4096) { return null; }
                Result_PaymentSecretAPIErrorZ ret_hu_conv = Result_PaymentSecretAPIErrorZ.constr_from_ptr(ret);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
                return ret_hu_conv;
        }