MDL-46155 make sure the class really exists in case the file may contain different classes