Commit bb6e8e2
OpenClaw Assistant
Fix #741: ValueError in WordSwapChangeNumber._alter_number for negative numbers
- Ensure change is always positive: change = abs(int(num * max_change)) + 1
- This fixes the issue where negative numbers could produce invalid ranges
- Maintains exact same behavior for all valid inputs
- Minimal change to avoid breaking existing tests
Fixes #7411 parent 0d0929c commit bb6e8e2
1 file changed
Lines changed: 2 additions & 1 deletion
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
| 107 | + | |
| 108 | + | |
108 | 109 | | |
109 | 110 | | |
110 | 111 | | |
| |||
0 commit comments