]> source.dussan.org Git - gitblit.git/commitdiff
[findbugs] Add null check on decoding a string in StringUtils
authorJames Moger <james.moger@gitblit.com>
Fri, 18 Apr 2014 02:45:56 +0000 (22:45 -0400)
committerJames Moger <james.moger@gitblit.com>
Fri, 18 Apr 2014 03:08:07 +0000 (23:08 -0400)
src/main/java/com/gitblit/utils/StringUtils.java

index 7605fe01b21e41a5647685843484a12e31ac98fc..d7e1ea3db756ee49e38742e437d8f367961e9277 100644 (file)
@@ -642,7 +642,7 @@ public class StringUtils {
                                // ignore unsupported charsets\r
                        }\r
                }\r
-               if (value.startsWith("\uFEFF")) {\r
+               if (value != null && value.startsWith("\uFEFF")) {\r
                        // strip UTF-8 BOM\r
             return value.substring(1);\r
         }\r