Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle invalid input in the TextField event listener in SimpletimerDemo #38

Open
coderabbitai bot opened this issue Jul 1, 2024 · 0 comments
Open
Assignees

Comments

@coderabbitai
Copy link

coderabbitai bot commented Jul 1, 2024

There is an existing bug in the TextField event listener in SimpletimerDemo.java, where invalid input is not properly handled. This issue was preserved in the recent refactor in PR #37.

PR: #37
Comment: #37 (comment)

The bug can be fixed by ensuring that the input value is a valid number before updating the time field. Here is a suggested fix:

new TextField("Start Time", e -> {
  try {
    time = new BigDecimal(e.getValue());
  } catch (NumberFormatException ex) {
    Notification.show("Invalid input. Please enter a valid number.");
    return;
  }
  update();
});

This issue needs to be addressed to improve the robustness of the application.

@javier-godoy javier-godoy removed their assignment Jul 1, 2024
@github-project-automation github-project-automation bot moved this to Inbox (needs triage) in Flowing Code Addons Jul 1, 2024
@paodb paodb moved this from Inbox (needs triage) to To Do in Flowing Code Addons Jul 2, 2024
@scardanzan scardanzan moved this from To Do to In Progress in Flowing Code Addons Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

No branches or pull requests

2 participants