Fixed: Backport, Escape potential NPE when call DataEvents.serverImage by mocked request

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release17.12@1857458 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Nicolas Malin
2019-04-13 09:29:43 +00:00
parent 134d7b31cf
commit fa353ccded
@@ -270,7 +270,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";
}