X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;ds=sidebyside;f=ts%2Fstructs%2FCommonBase.mts;h=df2cad8ec388482aa6a22c6efed2355e019cfb6d;hb=fcd77e9d9d1227cfe3d26b8bdebbe2fb2aa76354;hp=8ce5766a2b089de0af3adaeb1d76bfd1e0202ba6;hpb=f6d7282fcf6324519ea1fe4b584c8d02c95acd9e;p=ldk-java diff --git a/ts/structs/CommonBase.mts b/ts/structs/CommonBase.mts index 8ce5766a..df2cad8e 100644 --- a/ts/structs/CommonBase.mts +++ b/ts/structs/CommonBase.mts @@ -374,7 +374,7 @@ export class CommonBase { // In TypeScript, protected means "any subclass can access parent fields on instances of itself" // To work around this, we add accessors for other instances' protected fields here. protected static add_ref_from(holder: CommonBase, referent: object) { - holder.ptrs_to.push(referent); + if (holder !== null) { holder.ptrs_to.push(referent); } } protected static get_ptr_of(o: CommonBase) { return o.ptr;