v0.3.4a: added a safety check to capitalize

This commit is contained in:
Evan Debenham 2016-02-12 01:35:53 -05:00 committed by Evan Debenham
parent 7c8247577e
commit 789f8e31a8

View File

@ -145,7 +145,8 @@ public class Messages {
}
public static String capitalize( String str ){
return Character.toTitleCase( str.charAt( 0 ) ) + str.substring( 1 );
if (str.length() == 0) return str;
else return Character.toTitleCase( str.charAt( 0 ) ) + str.substring( 1 );
}
//Words which should not be capitalized in title case, mostly prepositions which appear ingame