svn commit: r1857457 - /ofbiz/branches/release16.11/applications/content/src/main/java/org/apache/ofbiz/content/data/DataEvents.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1857457 - /ofbiz/branches/release16.11/applications/content/src/main/java/org/apache/ofbiz/content/data/DataEvents.java

nmalin
Author: nmalin
Date: Sat Apr 13 09:29:18 2019
New Revision: 1857457

URL: http://svn.apache.org/viewvc?rev=1857457&view=rev
Log:
Fixed: Backport, Escape potential NPE when call by DataEvents.serverImage by mocked request

Modified:
    ofbiz/branches/release16.11/applications/content/src/main/java/org/apache/ofbiz/content/data/DataEvents.java

Modified: ofbiz/branches/release16.11/applications/content/src/main/java/org/apache/ofbiz/content/data/DataEvents.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release16.11/applications/content/src/main/java/org/apache/ofbiz/content/data/DataEvents.java?rev=1857457&r1=1857456&r2=1857457&view=diff
==============================================================================
--- ofbiz/branches/release16.11/applications/content/src/main/java/org/apache/ofbiz/content/data/DataEvents.java (original)
+++ ofbiz/branches/release16.11/applications/content/src/main/java/org/apache/ofbiz/content/data/DataEvents.java Sat Apr 13 09:29:18 2019
@@ -274,7 +274,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";
             }