From b1546d7382039d1b0bb46e5f023347a4fdc75e79 Mon Sep 17 00:00:00 2001 From: Nils-Helge Garli Date: Sat, 26 Jan 2008 08:53:12 +0000 Subject: [PATCH] WW-2240 Temporary workaround for NPE problems when doing info logging. Patch by Benjamin McCann git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@615436 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/struts2/interceptor/FileUploadInterceptor.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/org/apache/struts2/interceptor/FileUploadInterceptor.java b/core/src/main/java/org/apache/struts2/interceptor/FileUploadInterceptor.java index 03d13d1fa..961720f62 100644 --- a/core/src/main/java/org/apache/struts2/interceptor/FileUploadInterceptor.java +++ b/core/src/main/java/org/apache/struts2/interceptor/FileUploadInterceptor.java @@ -274,8 +274,9 @@ public class FileUploadInterceptor extends AbstractInterceptor { File[] file = multiWrapper.getFiles(inputValue); for (int index = 0; index < file.length; index++) { File currentFile = file[index]; - LOG.info(getTextMessage("struts.messages.removing.file", new Object[]{inputValue, currentFile}, ActionContext.getContext().getLocale())); - + if(LOG.isInfoEnabled()) { + LOG.info(getTextMessage("struts.messages.removing.file", new Object[]{inputValue, currentFile}, ActionContext.getContext().getLocale())); + } if ((currentFile != null) && currentFile.isFile()) { currentFile.delete(); }