Commit 4285347
committed
fix: validate empty input in Word-Building game to prevent IndexError
Closes steam-bell-92#1312
Add .strip() and empty-string check before accessing user_word[0].
Empty input was crashing with 'IndexError: string index out of range'
on lines 41 and 56.1 parent 793620e commit 4285347
1 file changed
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
41 | 44 | | |
42 | 45 | | |
43 | 46 | | |
| |||
0 commit comments