fix: Setup Outfit cause NRE when nothing selected

This commit is contained in:
Sayamame-beans 2024-09-23 19:18:39 +09:00
parent fd3de6e680
commit 37ba27c839

View File

@ -386,6 +386,14 @@ namespace nadena.dev.modular_avatar.core.editor
private static bool ValidateSetupOutfit(GameObject gameObj)
{
Object obj;
if (gameObj == null)
{
errorHeader = S("setup_outfit.err.header.notarget");
errorMessageGroups = new string[] { S("setup_outfit.err.no_selection") };
return false;
}
errorHeader = S_f("setup_outfit.err.header", gameObj.name);
var xform = gameObj.transform;
@ -542,4 +550,4 @@ namespace nadena.dev.modular_avatar.core.editor
return avatarHips != null && outfitHips != null;
}
}
}
}