| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -336,7 +336,15 @@ static public void setBoolean(String attribute, boolean value) { | |||
| 336 | 336 | ||
| 337 | 337 | ||
| 338 | 338 | static public int getInteger(String attribute /*, int defaultValue*/) { | |
| 339 | - return Integer.parseInt(get(attribute)); | ||
| 339 | + try { | ||
| 340 | + return Integer.parseInt(get(attribute)); | ||
| 341 | + } catch (NumberFormatException err) { | ||
| 342 | + try { | ||
| 343 | + return Integer.parseInt(getDefault(attribute)); | ||
| 344 | + } catch (NumberFormatException err2) { | ||
| 345 | + throw new IllegalArgumentException("Cannot parse: " + attribute); | ||
| 346 | + } | ||
| 347 | + } | ||
| 340 | 348 | } | |
| 341 | 349 | ||
| 342 | 350 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments