Skip to content

Commit 7c27d09

Browse files
committed
Added check for negative font size in preferences.
This should allow to automatically recover situations like #6359 (comment) See #6359
1 parent 5427f94 commit 7c27d09

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Diff for: arduino-core/src/processing/app/helpers/PreferencesHelper.java

+2
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ public static Font getFont(PreferencesMap prefs, String key) {
9494
try {
9595
// ParseDouble handle numbers with decimals too
9696
size = (int) Double.parseDouble(split[2]);
97+
if (size < 1) // Do not allow negative or zero size
98+
throw new NumberFormatException();
9799
} catch (NumberFormatException e) {
98100
// for wrong formatted size pick the default
99101
size = 12;

0 commit comments

Comments
 (0)