Permalink
Browse files

LPS-31104 String.valueOf returns "null"

  • Loading branch information...
1 parent 0aea6bf commit 262014cd2d2c1da29cb86d6fef246301c6dc2c6f @brianchandotcom brianchandotcom committed Nov 21, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 portal-impl/src/com/liferay/portal/servlet/BrowserSnifferImpl.java
@@ -18,6 +18,7 @@
import com.liferay.portal.kernel.servlet.HttpHeaders;
import com.liferay.portal.kernel.util.GetterUtil;
import com.liferay.portal.kernel.util.StringPool;
+import com.liferay.portal.kernel.util.Validator;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -336,7 +337,7 @@ protected String getAccept(HttpServletRequest request) {
accept = String.valueOf(request.getAttribute(HttpHeaders.ACCEPT));
- if (accept != null) {
+ if (Validator.isNotNull(accept)) {
return accept;
}
@@ -364,7 +365,7 @@ protected String getUserAgent(HttpServletRequest request) {
userAgent = String.valueOf(
request.getAttribute(HttpHeaders.USER_AGENT));
- if (userAgent != null) {
+ if (Validator.isNotNull(userAgent)) {
return userAgent;
}

0 comments on commit 262014c

Please sign in to comment.