From 27d864c752e7a915e8573917f214ad136d9a3d30 Mon Sep 17 00:00:00 2001 From: "Christian P. MOMON" Date: Fri, 6 Nov 2020 04:16:56 +0100 Subject: [PATCH] Add check for missing icon file. --- src/fr/devinsy/statoolinfos/htmlize/Htmlizer.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/fr/devinsy/statoolinfos/htmlize/Htmlizer.java b/src/fr/devinsy/statoolinfos/htmlize/Htmlizer.java index 7e59a5d..644f3bb 100644 --- a/src/fr/devinsy/statoolinfos/htmlize/Htmlizer.java +++ b/src/fr/devinsy/statoolinfos/htmlize/Htmlizer.java @@ -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); + } + } } /**