You mentioned that PromiseTypeAppendPromise() never returns NULL. When you are certain of a function behaviour, that's the proper usecase for assert(). If PromiseTypeAppendPromise() could possibly return NULL, then assert() is the wrong way to check.

Anyway that's minor nitpicking. I now checked that function, indeed it should never return NULL. If at some point somebody mistakenly changes that behaviour, this assert would catch it. Not really important, I would probably not use an assert here anyway, I was just mentioning that this makes some sense.