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 2025/02/27 19:44:45 UTC

(myfaces) branch 4.0.x updated: MYFACES-4714 Possible NPE in ClientWindowScopeContext#getContextualStorage

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 49e977b36 MYFACES-4714 Possible NPE in ClientWindowScopeContext#getContextualStorage
49e977b36 is described below

commit 49e977b36a2d6d889ddcdab42992723d7ace5f8e
Author: tandraschko <ta...@apache.org>
AuthorDate: Thu Feb 27 20:44:32 2025 +0100

    MYFACES-4714 Possible NPE in ClientWindowScopeContext#getContextualStorage
---
 .../apache/myfaces/cdi/clientwindow/ClientWindowScopeContext.java   | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/impl/src/main/java/org/apache/myfaces/cdi/clientwindow/ClientWindowScopeContext.java b/impl/src/main/java/org/apache/myfaces/cdi/clientwindow/ClientWindowScopeContext.java
index ccb02f478..293ab4088 100644
--- a/impl/src/main/java/org/apache/myfaces/cdi/clientwindow/ClientWindowScopeContext.java
+++ b/impl/src/main/java/org/apache/myfaces/cdi/clientwindow/ClientWindowScopeContext.java
@@ -72,7 +72,11 @@ protected ContextualStorage getContextualStorage(FacesContext facesContext, bool
         String windowId = getCurrentClientWindowId(facesContext);
         if (windowId != null)
         {
-            return getStorageHolder(facesContext).getContextualStorage(windowId, createIfNotExist);
+            ClientWindowScopeContextualStorageHolder storageHolder = getStorageHolder(facesContext);
+            if (storageHolder != null)
+            {
+                return storageHolder.getContextualStorage(windowId, createIfNotExist);
+            }
         }
         return null;
     }