In a maskless lithography apparatus light deflected by a patterning array out of a path towards a substrate is directed onto a detector that detects malfunctions of the patterning array. If the patterning array is of a type which selectively diverts radiation in order to pattern the beam, the detector can use the radiation that is diverted out of the beam. Alternatively, a second beam of radiation, additional to the exposure radiation, can be provided.