Add check for missing icon file.

This commit is contained in:
Christian P. MOMON 2020-11-06 04:16:56 +01:00
parent 62fa2b9399
commit 27d864c752

View file

@ -27,6 +27,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.devinsy.statoolinfos.HtmlizerContext;
import fr.devinsy.statoolinfos.core.Category;
import fr.devinsy.statoolinfos.core.Configuration;
import fr.devinsy.statoolinfos.core.StatoolInfosException;
import fr.devinsy.statoolinfos.core.StatoolInfosUtils;
@ -102,6 +103,17 @@ public class Htmlizer
}
}
}
// Check.
for (Category category : HtmlizerContext.instance().getCategories())
{
File categoryFile = new File(targetDirectory, category.getLogoPath());
if (!categoryFile.exists())
{
category.setLogoPath(null);
}
}
}
/**