You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2024/09/02 15:53:26 UTC

(myfaces-tobago) branch tobago-5.x updated: fix: less warnings (#5401)

This is an automated email from the ASF dual-hosted git repository.

lofwyr pushed a commit to branch tobago-5.x
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git


The following commit(s) were added to refs/heads/tobago-5.x by this push:
     new 95a96d73b5 fix: less warnings (#5401)
95a96d73b5 is described below

commit 95a96d73b5202ffc9b4080cf04429f32a4fbed6f
Author: Udo Schnurpfeil <lo...@apache.org>
AuthorDate: Mon Sep 2 17:53:20 2024 +0200

    fix: less warnings (#5401)
---
 .../myfaces/tobago/internal/renderkit/renderer/FileRenderer.java      | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/FileRenderer.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/FileRenderer.java
index e24361cd81..fa1309a346 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/FileRenderer.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/FileRenderer.java
@@ -94,7 +94,9 @@ public class FileRenderer<T extends AbstractUIFile>
             final String fileName = part.getSubmittedFileName();
             final String contentType = part.getContentType();
             LOG.debug("Uploaded file '{}', size={}, type='{}'.", fileName, part.getSize(), contentType);
-            if (StringUtils.isBlank(fileName)) {
+            if (part.getSize() == 0) {
+              LOG.debug("Ignoring empty file for clientId='{}'.", clientId);
+            } else if (StringUtils.isBlank(fileName)) {
               LOG.warn("No fileName provided for clientId='{}'.", clientId);
             } else if (StringUtils.isBlank(contentType)) {
               LOG.warn("No contentType provided for clientId='{}'.", clientId);