[PR #71] [MERGED] Gracefully handles empty/non-integer input at menu. Fixes #70 #101

Closed
opened 2026-03-02 04:06:48 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/FujiwaraChoki/MoneyPrinterV2/pull/71
Author: @Xeno852
Created: 3/19/2024
Status: Merged
Merged: 3/21/2024
Merged by: @FujiwaraChoki

Base: mainHead: main


📝 Commits (1)

  • e49befd Gracefully handles empty/non-integer input at menu

📊 Changes

2 files changed (+22 additions, -8 deletions)

View changed files

.python-version (+1 -0)
📝 src/main.py (+21 -8)

📄 Description

This PR fixes a crash occurring when users enter non-integer or empty inputs during menu option selection. It introduces input validation within a loop, ensuring users provide valid integers corresponding to menu options. Related issue: #70

Changes Made:

  • Modified the input handling in the main() function to include a loop that checks for and validates integer input.
  • Added error messaging to inform the user of invalid input and prompt for a retry.

How to Test:

  1. Run the program and reach the main menu.
  2. Press enter without typing anything or input a non-integer value.
  3. Verify that the program now prompts for input again instead of crashing.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/FujiwaraChoki/MoneyPrinterV2/pull/71 **Author:** [@Xeno852](https://github.com/Xeno852) **Created:** 3/19/2024 **Status:** ✅ Merged **Merged:** 3/21/2024 **Merged by:** [@FujiwaraChoki](https://github.com/FujiwaraChoki) **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (1) - [`e49befd`](https://github.com/FujiwaraChoki/MoneyPrinterV2/commit/e49befd9b81212646d9ff5fb2d383ced59682657) Gracefully handles empty/non-integer input at menu ### 📊 Changes **2 files changed** (+22 additions, -8 deletions) <details> <summary>View changed files</summary> ➕ `.python-version` (+1 -0) 📝 `src/main.py` (+21 -8) </details> ### 📄 Description This PR fixes a crash occurring when users enter non-integer or empty inputs during menu option selection. It introduces input validation within a loop, ensuring users provide valid integers corresponding to menu options. Related issue: #70 Changes Made: - Modified the input handling in the main() function to include a loop that checks for and validates integer input. - Added error messaging to inform the user of invalid input and prompt for a retry. How to Test: 1. Run the program and reach the main menu. 2. Press enter without typing anything or input a non-integer value. 3. Verify that the program now prompts for input again instead of crashing. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-02 04:06:48 +03:00
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#101
No description provided.