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.gitThe following commit(s) were added to refs/heads/trunk by this push:
new e3f6d15 Improved: Headerize external script in multi-block html template (OFBIZ-11741)
e3f6d15 is described below
commit e3f6d1547fbd77d2c1625cfa152cce582b9ad825
Author: James Yong <
[hidden email]>
AuthorDate: Sat Jun 6 14:28:32 2020 +0800
Improved: Headerize external script in multi-block html template (OFBIZ-11741)
Fix regression in scrumtests that resulted in NullPointerException.
---
.../org/apache/ofbiz/widget/model/MultiBlockHtmlTemplateUtil.java | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/MultiBlockHtmlTemplateUtil.java b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/MultiBlockHtmlTemplateUtil.java
index df005cd..1602642 100644
--- a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/MultiBlockHtmlTemplateUtil.java
+++ b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/MultiBlockHtmlTemplateUtil.java
@@ -167,6 +167,9 @@ public final class MultiBlockHtmlTemplateUtil {
*/
public static void storeScreenLocationName(final Map<String, Object> context, String location, String name) {
HttpServletRequest request = (HttpServletRequest) context.get("request");
+ if (request == null) {
+ return;
+ }
if (request.getAttribute(HTML_LINKS_FOR_HEAD) == null) {
String currentLocationHashName = location + "#" + name;
request.setAttribute(HTML_LINKS_FOR_HEAD, currentLocationHashName);
@@ -183,7 +186,9 @@ public final class MultiBlockHtmlTemplateUtil {
*/
public static void addLinksToLayoutSettings(final Map<String, Object> context) throws IOException {
HttpServletRequest request = (HttpServletRequest) context.get("request");
-
+ if (request == null) {
+ return;
+ }
// check "layoutSettings.javaScripts" is not empty
Map<String, Object> layoutSettings = UtilGenerics.cast(context.get("layoutSettings"));
if (UtilValidate.isEmpty(layoutSettings)) {