Recognizing nullhomotopic maps into the classifying space of a Kac–Moody group