Merge pull request #4115 from wwn/issue#4077

Added String.length() > 0 check to avoid IndexOutOfBoundException
This commit is contained in:
wing328
2016-11-03 15:33:47 +08:00
committed by GitHub

View File

@@ -2947,7 +2947,7 @@ public class DefaultCodegen {
m = p.matcher(word);
}
if (lowercaseFirstLetter) {
if (lowercaseFirstLetter && word.length() > 0) {
word = word.substring(0, 1).toLowerCase() + word.substring(1);
}