  Modular invariance is a necessary condition for the consistency of any closed
string theory. In particular, it imposes stringent constraints on the spectrum
of orbifold theories, and in principle determines their spectrum uniquely up to
discrete torsion classes. In practice, however, there are often ambiguities in
the construction of orbifolds that are a consequence of the fact that the
action of the orbifold elements on degenerate ground states is not unambiguous.
We explain that there exists an additional consistency condition, related to
the spectrum of D-branes in the theory, which eliminates these ambiguities. For
supersymmetric orbifolds this condition turns out to be equivalent to the
condition that supersymmetry is unbroken in the twisted sectors, but for
non-supersymmetric orbifolds it appears to be a genuinely new consistency
condition.
