check we're in child context before dereferencing ->child