myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tandrasc...@apache.org
Subject [myfaces] branch master updated: avoid NPE
Date Sat, 10 Aug 2019 16:14:05 GMT
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
     new 27618ce  avoid NPE
27618ce is described below

commit 27618ce8b676c847a93226f831202c125a5cbc93
Author: Thomas Andraschko <tandraschko@apache.org>
AuthorDate: Sat Aug 10 18:13:59 2019 +0200

    avoid NPE
---
 .../apache/myfaces/view/facelets/impl/DefaultFaceletFactory.java   | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/impl/DefaultFaceletFactory.java
b/impl/src/main/java/org/apache/myfaces/view/facelets/impl/DefaultFaceletFactory.java
index c99ba40..7730daf 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/impl/DefaultFaceletFactory.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/impl/DefaultFaceletFactory.java
@@ -350,7 +350,8 @@ public final class DefaultFaceletFactory extends FaceletFactory
             log.fine("Creating Facelet for: " + url);
         }
 
-        String alias = '/' + _removeFirst(url.getFile(), getBaseUrl().getFile());
+        URL baseUrl = getBaseUrl();
+        String alias = '/' + _removeFirst(url.getFile(), baseUrl == null ? "" : baseUrl.getFile());
         try
         {
             FaceletHandler h = _compiler.compile(url, alias);
@@ -383,7 +384,8 @@ public final class DefaultFaceletFactory extends FaceletFactory
 
         // The alias is used later for informative purposes, so we append 
         // some prefix to identify later where the errors comes from.
-        String faceletId = '/' + _removeFirst(url.getFile(), getBaseUrl().getFile());
+        URL baseUrl = getBaseUrl();
+        String faceletId = '/' + _removeFirst(url.getFile(), baseUrl == null ? "" : baseUrl.getFile());
         String alias = "/viewMetadata" + faceletId;
         try
         {
@@ -396,7 +398,6 @@ public final class DefaultFaceletFactory extends FaceletFactory
         {
             throw new FileNotFoundException("Facelet " + alias + " not found at: " + url.toExternalForm());
         }
-
     }
     
     /**


Mime
View raw message