1
0
Fork 1

Force a valid boolean value if server sent an invalid one

(such as blank)

(cherry picked from commit b80654b361a82d6266180bd0b4910a0125668a4d)
This commit is contained in:
Stephen Paul Weber 2024-09-18 13:46:41 -05:00 committed by Arne
parent 3975c0befa
commit d32bcc6c61

View file

@ -2085,7 +2085,9 @@ public class Conversation extends AbstractEntity implements Blockable, Comparabl
binding.label.setText(field.getLabel().or(""));
setTextOrHide(binding.desc, field.getDesc());
mValue = field.getValue();
binding.checkbox.setChecked(mValue.getContent() != null && (mValue.getContent().equals("true") || mValue.getContent().equals("1")));
final var isChecked = mValue.getContent() != null && (mValue.getContent().equals("true") || mValue.getContent().equals("1"));
mValue.setContent(isChecked ? "true" : "false");
binding.checkbox.setChecked(isChecked);
}
@Override