getAssociated error

Check if the object have the method getAssociated before trying use this method.