[addoncallbacks] check key is non-null before use
Merge pull request #5032 from jmarshallnz/addon_callbacks_nonnull

[addoncallbacks] check key is non-null before use