Necessary?  That's up for interpretation.

I don't believe it hurts anything and it protects from people passing in a string for a.data as one example of an added verification it is doing for us.