fix: missing layers in avatar descriptor can result in KeyNotFoundException (#959)

Closes: #958
This commit is contained in:
bd_ 2024-08-06 20:48:50 -07:00 committed by GitHub
parent 1c766e9fe8
commit dee5241436
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -150,7 +150,9 @@ namespace nadena.dev.modular_avatar.core.editor
basePath = "";
}
bool? writeDefaults = merge.matchAvatarWriteDefaults ? writeDefaults_[merge.layerType] : null;
var writeDefaults = merge.matchAvatarWriteDefaults
? writeDefaults_.GetValueOrDefault(merge.layerType)
: null;
var controller = _context.ConvertAnimatorController(merge.animator);
session.AddController(basePath, controller, writeDefaults);