Commit 812e693
committed
Fix remaining 7 code review issues
1-3. Add null checks for type and weaponDef before accessing in perferedUnit
4. Fix Spring.GetUnitCommands parameter - use fixed 100 instead of variable stockpile
5. Add null check for unit position before using in distance calculation
6. Add null check for tabButton.button before calling SetVisibility
7. Initialize WG.missileTotalCount in widget:Initialize to fix badge when disabled
All fixes are defensive nil/validation checks to prevent crashes.
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GiaPfKSj8kGFjaUPyxYYHd1 parent 7173b99 commit 812e693
2 files changed
Lines changed: 15 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2604 | 2604 | | |
2605 | 2605 | | |
2606 | 2606 | | |
2607 | | - | |
| 2607 | + | |
2608 | 2608 | | |
2609 | 2609 | | |
2610 | 2610 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
17 | 21 | | |
18 | 22 | | |
19 | 23 | | |
| |||
81 | 85 | | |
82 | 86 | | |
83 | 87 | | |
84 | | - | |
| 88 | + | |
85 | 89 | | |
86 | 90 | | |
87 | 91 | | |
| |||
142 | 146 | | |
143 | 147 | | |
144 | 148 | | |
145 | | - | |
| 149 | + | |
146 | 150 | | |
147 | 151 | | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
148 | 155 | | |
| 156 | + | |
149 | 157 | | |
150 | 158 | | |
151 | 159 | | |
| |||
154 | 162 | | |
155 | 163 | | |
156 | 164 | | |
| 165 | + | |
| 166 | + | |
157 | 167 | | |
| 168 | + | |
158 | 169 | | |
159 | 170 | | |
160 | 171 | | |
| |||
244 | 255 | | |
245 | 256 | | |
246 | 257 | | |
| 258 | + | |
247 | 259 | | |
248 | 260 | | |
249 | 261 | | |
| |||
0 commit comments