Protection added to fix ROOT-6564