$injector might not exist, e.g. if called via shutdown/destructors.