Do not throw if rendering null values. Not clear how they get in the list yet

dbus-notify
Zlatin Balevsky 2022-06-08 18:26:02 +01:00
parent e5ad1f7ca6
commit af21cae225
No known key found for this signature in database
GPG Key ID: A72832072D525E41
1 changed files with 6 additions and 0 deletions

View File

@ -23,9 +23,15 @@ class PersonaOrProfileListCellRenderer extends DefaultListCellRenderer {
@Override
Component getListCellRendererComponent(JList<?> list, Object v,
int index, boolean isSelected, boolean cellHasFocus) {
if (v == null)
return this
super.getListCellRendererComponent(list, v, index, isSelected, cellHasFocus)
PersonaOrProfile value = (PersonaOrProfile)v
if (value.getPersona() == null)
return this
String text
if (settings.personaRendererIds)
text = "<html>" + PersonaCellRenderer.htmlize(value.getPersona()) + "</html>"