Protection added to fix ROOT-5886