You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by me...@apache.org on 2022/12/05 13:17:37 UTC

[myfaces] branch 2.3-next updated: MYFACES-4512: avoid NPE in createView (#405)

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

melloware pushed a commit to branch 2.3-next
in repository https://gitbox.apache.org/repos/asf/myfaces.git


The following commit(s) were added to refs/heads/2.3-next by this push:
     new 14d1ced34 MYFACES-4512: avoid NPE in createView (#405)
14d1ced34 is described below

commit 14d1ced34cc66835aa1c33831d94b27d863e8cb4
Author: Paul A. Nicolucci <pn...@gmail.com>
AuthorDate: Mon Dec 5 08:17:32 2022 -0500

    MYFACES-4512: avoid NPE in createView (#405)
---
 .../myfaces/view/facelets/FaceletViewDeclarationLanguage.java  | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletViewDeclarationLanguage.java b/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletViewDeclarationLanguage.java
index 8c0d9af9f..8033b8801 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletViewDeclarationLanguage.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletViewDeclarationLanguage.java
@@ -1937,9 +1937,13 @@ public class FaceletViewDeclarationLanguage extends FaceletViewDeclarationLangua
                 //Ensure calculateResourceLibraryContracts() can be decorated
                 ViewDeclarationLanguage vdl = context.getApplication().getViewHandler()
                         .getViewDeclarationLanguage(context, viewId);
-                List<String> contracts = vdl.calculateResourceLibraryContracts(
-                    context, root.getViewId() != null ? root.getViewId() : viewId);
-                context.setResourceLibraryContracts(contracts);
+
+                if (vdl != null)
+                {
+                    List<String> contracts = vdl.calculateResourceLibraryContracts(
+                        context, root.getViewId() != null ? root.getViewId() : viewId);
+                    context.setResourceLibraryContracts(contracts);
+                }
             }
             return root;
         }