There's no guarantee here that addon is non-NULL I think?

So you should really use the addon->Name() if it's available, else fallback to the previous code.