forked from I2P_Developers/i2p.i2p
Console: Fix NPE on /configsidebar (ticket #2220)
Don't throw NPE translating null Add note about split() Fix form inside table
This commit is contained in:
@ -1950,6 +1950,9 @@ public class DataHelper {
|
||||
* Same as s.split(regex) but caches the compiled pattern for speed.
|
||||
* This saves about 10 microseconds (Bulldozer) on subsequent invocations.
|
||||
*
|
||||
* Note: For an input "" this returns [""], not a zero-length array.
|
||||
* This is the same behavior as String.split().
|
||||
*
|
||||
* @param s non-null
|
||||
* @param regex non-null, don't forget to enclose multiple choices with []
|
||||
* @throws java.util.regex.PatternSyntaxException unchecked
|
||||
@ -1965,6 +1968,9 @@ public class DataHelper {
|
||||
* Same as s.split(regex, limit) but caches the compiled pattern for speed.
|
||||
* This saves about 10 microseconds (Bulldozer) on subsequent invocations.
|
||||
*
|
||||
* Note: For an input "" this returns [""], not a zero-length array.
|
||||
* This is the same behavior as String.split().
|
||||
*
|
||||
* @param s non-null
|
||||
* @param regex non-null, don't forget to enclose multiple choices with []
|
||||
* @param limit result threshold
|
||||
|
@ -43,6 +43,10 @@ public abstract class Translate {
|
||||
|
||||
/** lang in routerconsole.lang property, else current locale */
|
||||
public static String getString(String key, I2PAppContext ctx, String bun) {
|
||||
if (key == null) {
|
||||
(new NullPointerException("null translation string")).printStackTrace();
|
||||
return "";
|
||||
}
|
||||
String lang = getLanguage(ctx);
|
||||
if (lang.equals("en"))
|
||||
return key;
|
||||
|
Reference in New Issue
Block a user