Skip to content

Commit

Permalink
Fixes error when non-integer numbers were entered into duration fields
Browse files Browse the repository at this point in the history
  • Loading branch information
nwaldispuehl committed Jul 11, 2021
1 parent 53eed45 commit fd7ce79
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 13 deletions.
7 changes: 4 additions & 3 deletions intervalmusiccompositor.app/src/main/resources/CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ retorte laboratories (retorte.ch) IntervalMusicCompositor change log
2021-07-xx 2.10.0 [not yet released]
--------------------------------------------------------------------------------
IMP #59 Inactivates process button if no compilation is possible.
FIX #61 Fixes encoding tests in some environment by explicitly states encoding.
FIX #58 Fixes crash with wrong Java version by bundling Java with the application.
FIX #60 Fixes that in advanced pattern too long breaks with break track were swallowed.
FIX #61 Failing encoding tests in some environment by explicitly states encoding.
FIX #58 Crash with wrong Java version by bundling Java with the application.
FIX #60 In advanced pattern too long breaks with break track were swallowed.
FIX Settings in the starting window were not reflected in preferences dialog.
FIX Error when non-integer numbers were entered into duration fields.


2019-03-05 2.9.2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,27 @@
*/
public class NullTolerantIntegerStringConverter extends IntegerStringConverter {

//---- Fields
//---- Fields

private static final Integer DEFAULT_VALUE = 0;
private static final Integer DEFAULT_VALUE = 0;


//---- Methods
//---- Methods

@Override
public Integer fromString(String value) {
Integer result = super.fromString(value);
if (result == null) {
return DEFAULT_VALUE;
@Override
public Integer fromString(String value) {
Integer result = null;

try {
result = super.fromString(value);
} catch (NumberFormatException e) {
// nop
}

if (result == null) {
return DEFAULT_VALUE;
}

return result;
}
return result;
}
}

0 comments on commit fd7ce79

Please sign in to comment.