fix: Setup Outfit cause NRE when nothing selected (#1197)

This commit is contained in:
Sayamame-beans 2024-09-24 11:12:39 +09:00 committed by GitHub
parent fd3de6e680
commit 3b86822547
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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;
}
}
}
}