FujiwaraChoki / MoneyPrinterV2

Automate the process of making money online.
GNU Affero General Public License v3.0
2.23k stars 302 forks source link

Handle Empty or Non-Integer Input Gracefully in Option Selection #70

Closed Xeno852 closed 3 months ago

Xeno852 commented 3 months ago

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:

Actual Result:

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.

FujiwaraChoki commented 3 months ago

Well done!