Author: nmalin
Date: Sat Apr 13 09:29:53 2019
New Revision: 1857459
URL:
http://svn.apache.org/viewvc?rev=1857459&view=revLog:
Fixed: Backport, Escape potential NPE when call DataEvents.serverImage by mocked request
Modified:
ofbiz/ofbiz-framework/branches/release18.12/applications/content/src/main/java/org/apache/ofbiz/content/data/DataEvents.java
Modified: ofbiz/ofbiz-framework/branches/release18.12/applications/content/src/main/java/org/apache/ofbiz/content/data/DataEvents.java
URL:
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/branches/release18.12/applications/content/src/main/java/org/apache/ofbiz/content/data/DataEvents.java?rev=1857459&r1=1857458&r2=1857459&view=diff==============================================================================
--- ofbiz/ofbiz-framework/branches/release18.12/applications/content/src/main/java/org/apache/ofbiz/content/data/DataEvents.java (original)
+++ ofbiz/ofbiz-framework/branches/release18.12/applications/content/src/main/java/org/apache/ofbiz/content/data/DataEvents.java Sat Apr 13 09:29:53 2019
@@ -276,7 +276,7 @@ public class DataEvents {
// hack for IE and mime types
String userAgent = request.getHeader("User-Agent");
- if (userAgent.indexOf("MSIE") > -1) {
+ if (userAgent != null && userAgent.indexOf("MSIE") > -1) {
Debug.logInfo("Found MSIE changing mime type from - " + mimeType, module);
mimeType = "application/octet-stream";
}