[GH-ISSUE #70] Handle Empty or Non-Integer Input Gracefully in Option Selection #55

Closed
opened 2026-03-02 04:06:29 +03:00 by kerem · 1 comment
Owner

Originally created by @Xeno852 on GitHub (Mar 19, 2024).
Original GitHub issue: https://github.com/FujiwaraChoki/MoneyPrinterV2/issues/70

There's an issue in the main menu option selection where pressing enter without inputting a value or inputting a non-integer value causes the program to crash with a ValueError. This happens because the program attempts to convert an empty string or a non-integer input directly to an integer without validation. The expected behavior would be for the program to prompt the user again for input until a valid integer that corresponds to one of the options is provided.

Steps to Reproduce:

  1. Run the program and reach the main menu.
  2. Press enter without typing anything or enter a non-integer value.

Expected Result:

  • The program should display an error message indicating the input is invalid and prompt for input again.

Actual Result:

  • The program crashes with a ValueError.

This issue could be fixed by adding a loop that validates the input before attempting to convert it to an integer, ensuring robust input handling.

Originally created by @Xeno852 on GitHub (Mar 19, 2024). Original GitHub issue: https://github.com/FujiwaraChoki/MoneyPrinterV2/issues/70 There's an issue in the main menu option selection where pressing enter without inputting a value or inputting a non-integer value causes the program to crash with a ValueError. This happens because the program attempts to convert an empty string or a non-integer input directly to an integer without validation. The expected behavior would be for the program to prompt the user again for input until a valid integer that corresponds to one of the options is provided. Steps to Reproduce: 1. Run the program and reach the main menu. 2. Press enter without typing anything or enter a non-integer value. Expected Result: - The program should display an error message indicating the input is invalid and prompt for input again. Actual Result: - The program crashes with a ValueError. This issue could be fixed by adding a loop that validates the input before attempting to convert it to an integer, ensuring robust input handling.
kerem closed this issue 2026-03-02 04:06:30 +03:00
Author
Owner

@FujiwaraChoki commented on GitHub (Mar 21, 2024):

Well done!

<!-- gh-comment-id:2011827126 --> @FujiwaraChoki commented on GitHub (Mar 21, 2024): Well done!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/MoneyPrinterV2#55
No description provided.