Skip to content

Commit 188385d

Browse files
committed
Catch MissingResourceException when language key is missing
1 parent de45fc9 commit 188385d

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

app/src/processing/app/Language.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,13 @@ static public Language init() {
165165

166166
/** Get translation from bundles. */
167167
static public String text(String text) {
168-
String result = init().bundle.getString(text);
169-
return (result == null) ? text : result;
168+
ResourceBundle bundle = init().bundle;
169+
170+
try {
171+
return bundle.getString(text);
172+
} catch (MissingResourceException e) {
173+
return text;
174+
}
170175
}
171176

172177

0 commit comments

Comments
 (0)