Commit 48d70f4
committed
Fix SB.view nil access and GroupField child registration
1. Fix crash at editor.lua:154 - check SB.view exists before accessing
- During View:init(), SB.view hasn't been assigned yet
- Editors are created before SB.view is set in widget.lua
2. Fix GroupField child field registration logic
- Changed from checking SB.view.useRmlUi (which is nil during init)
- Now checks: if field.fields exists AND field.Added doesn't exist
- RmlUi GroupFields: have .fields, no .Added → register children here
- Chili GroupFields: have .fields, have .Added → register in Added()
- This works regardless of when SB.view is set
Fixes:
- "attempt to index field 'view' (a nil value)" crash
- "Attempted to set non-existent field: sunDirX" (and other GroupField children)1 parent 279fd1a commit 48d70f4
1 file changed
+5
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
154 | | - | |
| 154 | + | |
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
| |||
363 | 363 | | |
364 | 364 | | |
365 | 365 | | |
366 | | - | |
367 | | - | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
368 | 370 | | |
369 | 371 | | |
370 | 372 | | |
| |||
0 commit comments