mirror of
https://github.com/arduino/Arduino.git
synced 2025-02-20 14:54:31 +01:00
Added check for negative font size in preferences.
This should allow to automatically recover situations like https://github.com/arduino/Arduino/issues/6359#issuecomment-324247440 See #6359
This commit is contained in:
parent
5427f94b9d
commit
7c27d09c6f
@ -94,6 +94,8 @@ public abstract class PreferencesHelper {
|
||||
try {
|
||||
// ParseDouble handle numbers with decimals too
|
||||
size = (int) Double.parseDouble(split[2]);
|
||||
if (size < 1) // Do not allow negative or zero size
|
||||
throw new NumberFormatException();
|
||||
} catch (NumberFormatException e) {
|
||||
// for wrong formatted size pick the default
|
||||
size = 12;
|
||||
|
Loading…
x
Reference in New Issue
Block a user