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

jamesyong pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 0088af8  Fixed: Open Screen file from browser (OFBIZ-12038)
0088af8 is described below

commit 0088af8b90aa6de658a605fe1c86dad12df1fb37
Author: James Yong <jamesy...@apache.org>
AuthorDate: Sat Oct 10 16:29:41 2020 +0800

    Fixed: Open Screen file from browser (OFBIZ-12038)
    
    Fix regresssions in integration tests
---
 .../src/main/java/org/apache/ofbiz/widget/model/HtmlWidget.java    | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git 
a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/HtmlWidget.java 
b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/HtmlWidget.java
index 62d3158..4dd8d43 100644
--- 
a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/HtmlWidget.java
+++ 
b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/HtmlWidget.java
@@ -168,8 +168,9 @@ public class HtmlWidget extends ModelScreenWidget {
                 if (insertWidgetBoundaryComments) {
                     
writer.append(HtmlWidgetRenderer.buildBoundaryComment("Begin", "Template", 
location));
                 }
-                if (!location.endsWith(".fo.ftl")) {
-                    String contextPath = ((HttpServletRequest) 
context.get("request")).getContextPath();
+                HttpServletRequest request = ((HttpServletRequest) 
context.get("request"));
+                if (!location.endsWith(".fo.ftl") && request != null) {
+                    String contextPath = request.getContextPath();
                     
writer.append(HtmlWidgetRenderer.beginNamedBorder("Template", location, 
contextPath));
                 }
 
@@ -181,7 +182,7 @@ public class HtmlWidget extends ModelScreenWidget {
                 }
                 FreeMarkerWorker.renderTemplate(template, context, writer);
 
-                if (!location.endsWith(".fo.ftl")) {
+                if (!location.endsWith(".fo.ftl") && request != null) {
                     
writer.append(HtmlWidgetRenderer.endNamedBorder("Template", location));
                 }
                 if (insertWidgetBoundaryComments) {

Reply via email to