mirror of
https://github.com/mitb-archive/filebot
synced 2024-11-04 08:25:03 -05:00
* more resilient error handling in case of illegal user locale
This commit is contained in:
parent
b509f108d0
commit
f7c2d8eb69
@ -67,7 +67,7 @@ public class Language {
|
||||
try {
|
||||
return new Language(code, bundle.getString(code + ".name"));
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
return new Language(code, new Locale(code).getDisplayLanguage(Locale.ROOT));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -235,7 +235,9 @@ public class RenamePanel extends JComponent {
|
||||
@Override
|
||||
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
|
||||
super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
|
||||
setIcon(ResourceManager.getFlagIcon(((Language) value).getCode()));
|
||||
if (value != null) {
|
||||
setIcon(ResourceManager.getFlagIcon(((Language) value).getCode()));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user