if (!_todir.isDirectory()) {
if (_todir != null && !_todir.isDirectory()) {
    public void execute() throws BuildException {        Ivy ivy = getIvyInstance();                _organisation = getProperty(_organisation, ivy, "ivy.organisation");        _module = getProperty(_module, ivy, "ivy.module");        if (_cache == null) {            _cache = ivy.getDefaultCache();        }        _conf = getProperty(_conf, ivy, "ivy.resolved.configurations");        if (_conf.equals("*")) {            _conf = getProperty(ivy, "ivy.resolved.configurations");        }        if (_todir == null) {            String t = getProperty(ivy, "ivy.report.todir");            if (t != null) {                _todir = new File(t);            }        }        _outputpattern = getProperty(_outputpattern, ivy, "ivy.report.output.pattern");        if (_todir != null && _todir.exists()) {            _todir.mkdirs();        }        if (_outputpattern == null) {            _outputpattern = "[organisation]-[module]-[conf].html";        }                if (!_todir.isDirectory()) {            throw new BuildException("destination directory should be a directory !");        }        if (_organisation == null) {            throw new BuildException("no organisation provided for ivy report task: It can either be set explicitely via the attribute 'organisation' or via 'ivy.organisation' property or a prior call to <resolve/>");        }        if (_module == null) {            throw new BuildException("no module name provided for ivy report task: It can either be set explicitely via the attribute 'module' or via 'ivy.module' property or a prior call to <resolve/>");        }        try {            String[] confs = splitConfs(_conf);            for (int i = 0; i < confs.length; i++) {                genreport(ivy, _cache, _organisation, _module, confs[i]);                if (_graph) {                    gengraph(ivy, _cache, _organisation, _module, confs[i]);                }            }        } catch (IOException e) {            throw new BuildException("impossible to generate report", e);        }    }