1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-11-28 09:24:14 +01:00

Avoid error on save, if canceled theme instalation

This commit is contained in:
Ricardo JL Rufino 2020-05-13 21:39:52 -03:00
parent 4007b8470d
commit c906806a47

View File

@ -798,7 +798,10 @@ public class Preferences extends javax.swing.JDialog {
if (comboTheme.getSelectedIndex() == 0) {
PreferencesData.set("theme.file", "");
} else {
PreferencesData.set("theme.file", ((ZippedTheme) comboTheme.getSelectedItem()).getKey());
Object selectedItem = comboTheme.getSelectedItem();
if(selectedItem instanceof ZippedTheme) {
PreferencesData.set("theme.file", ((ZippedTheme) selectedItem).getKey());
}
}
String newSizeText = fontSizeField.getText();