mirror of https://github.com/noisymime/Arduino.git
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 {
|
try {
|
||||||
// ParseDouble handle numbers with decimals too
|
// ParseDouble handle numbers with decimals too
|
||||||
size = (int) Double.parseDouble(split[2]);
|
size = (int) Double.parseDouble(split[2]);
|
||||||
|
if (size < 1) // Do not allow negative or zero size
|
||||||
|
throw new NumberFormatException();
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
// for wrong formatted size pick the default
|
// for wrong formatted size pick the default
|
||||||
size = 12;
|
size = 12;
|
||||||
|
|
Loading…
Reference in New Issue