mirror of
https://github.com/duckietm/Nitro-V3.git
synced 2026-06-19 15:06:20 +00:00
fix: null-check the set type before reading .paletteID in avatar editor
`buildCategory` was reading `set.paletteID` on the line directly above the `if(!set || !palette) return null` guard. For categories where `getSetType()` legitimately returns null (PETS, MISC with no figure data on the server), this threw "can't access property paletteID, set is null" and triggered the WidgetErrorBoundary when the user opened the avatar editor. Split the guard: bail out as soon as `set` is null, then resolve the palette, then bail again if that's null too. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -264,9 +264,12 @@ const useAvatarEditorState = () =>
|
||||
for(let i = 0; i < MAX_PALETTES; i++) colorItems.push([]);
|
||||
|
||||
const set = GetAvatarRenderManager().structureData.getSetType(setType);
|
||||
|
||||
if(!set) return null;
|
||||
|
||||
const palette = GetAvatarRenderManager().structureData.getPalette(set.paletteID);
|
||||
|
||||
if(!set || !palette) return null;
|
||||
if(!palette) return null;
|
||||
|
||||
for(const partColor of palette.colors.getValues())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user