File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -1854,11 +1854,18 @@ public void handlePrefs() {
18541854 * Adjust font size
18551855 */
18561856 public void handleFontSizeChange (int change ) {
1857- String pieces [] = PApplet .split (PreferencesData .get ("editor.font" ), ',' );
1858- int newSize = Integer .parseInt (pieces [2 ]) + change ;
1859- pieces [2 ] = String .valueOf (newSize );
1860- PreferencesData .set ("editor.font" , PApplet .join (pieces , ',' ));
1861- this .getEditors ().forEach (processing .app .Editor ::applyPreferences );
1857+ String pieces [] = PreferencesData .get ("editor.font" ).split ("," );
1858+ try {
1859+ int newSize = Integer .parseInt (pieces [2 ]) + change ;
1860+ if (newSize < 4 )
1861+ newSize = 4 ;
1862+ pieces [2 ] = String .valueOf (newSize );
1863+ } catch (NumberFormatException e ) {
1864+ // ignore
1865+ return ;
1866+ }
1867+ PreferencesData .set ("editor.font" , StringUtils .join (pieces , ',' ));
1868+ getEditors ().forEach (Editor ::applyPreferences );
18621869 }
18631870
18641871 // XXX: Remove this method and make librariesIndexer non-static
You can’t perform that action at this time.
0 commit comments