You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by ta...@apache.org on 2024/01/04 09:37:11 UTC

(myfaces) branch 4.0.x updated: MYFACES-4636

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

tandraschko pushed a commit to branch 4.0.x
in repository https://gitbox.apache.org/repos/asf/myfaces.git


The following commit(s) were added to refs/heads/4.0.x by this push:
     new 1dbc0183c MYFACES-4636
1dbc0183c is described below

commit 1dbc0183c7f2bac574a096fc323ef726b3f961b9
Author: Thomas Andraschko <ta...@apache.org>
AuthorDate: Thu Jan 4 10:36:37 2024 +0100

    MYFACES-4636
---
 .../java/org/apache/myfaces/core/api/shared/SelectItemsUtil.java   | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/api/src/main/java/org/apache/myfaces/core/api/shared/SelectItemsUtil.java b/api/src/main/java/org/apache/myfaces/core/api/shared/SelectItemsUtil.java
index 08bb2c949..825db740e 100644
--- a/api/src/main/java/org/apache/myfaces/core/api/shared/SelectItemsUtil.java
+++ b/api/src/main/java/org/apache/myfaces/core/api/shared/SelectItemsUtil.java
@@ -288,7 +288,12 @@ public class SelectItemsUtil
             UIComponent uiComponent, Object value, SelectItem selectItem, Converter converter)
     {
         Object itemValue = selectItem.getValue();
-        if (converter != null && itemValue instanceof String)
+        if (itemValue == null && value == null)
+        {
+            return null;
+        }
+
+        if (converter != null && !(value instanceof String) && itemValue instanceof String)
         {
             itemValue = converter.getAsObject(facesContext, uiComponent, (String) itemValue);
         }