Witouht knowing the precise circumstances surrounding the error you are getting, I could only assume that you are attempting to use an object from B that has not first been instanciated.