Avoid crashes due to setting value outside of range
In case of bad value (cherry picked from commit ce44735aeb123dcf10fefce6922cb886cab89b86)
This commit is contained in:
parent
0c841f1aa3
commit
3975c0befa
1 changed files with 6 additions and 1 deletions
|
@ -2538,7 +2538,12 @@ public class Conversation extends AbstractEntity implements Blockable, Comparabl
|
|||
}
|
||||
|
||||
if (field.getValues().size() > 0) {
|
||||
binding.slider.setValue(Float.valueOf(field.getValue().getContent()));
|
||||
final var val = Float.valueOf(field.getValue().getContent());
|
||||
if ((min == null || val >= min) && (max == null || val <= max)) {
|
||||
binding.slider.setValue(Float.valueOf(field.getValue().getContent()));
|
||||
} else {
|
||||
binding.slider.setValue(min == null ? Float.MIN_VALUE : min);
|
||||
}
|
||||
} else {
|
||||
binding.slider.setValue(min == null ? Float.MIN_VALUE : min);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue