Skip to content

Commit

Permalink
i18n: throw an exception if an empty key was requested in `Localizabl…
Browse files Browse the repository at this point in the history
…eSupport`

Follow-up to 921d4b5.
  • Loading branch information
carlosame committed Aug 19, 2024
1 parent da7a0e7 commit e2df9a8
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,9 @@ public String getString(String key) throws MissingResourceException {
}
}
String classStr = (cls != null) ? cls.toString() : bundleName;
if (key.isEmpty()) {
throw new MissingResourceException("Requested an empty resource key.", classStr, key);
}
System.err.println("Unable to find resource: " + key + " in " + classStr);
return key;
}
Expand Down

0 comments on commit e2df9a8

Please sign in to comment.