若nameinfo[0]没有对应的剪影素材,则剪影全为male

This commit is contained in:
lieren2023 2024-04-12 08:44:01 +08:00 committed by GitHub
parent 5813592342
commit 4898cf38fb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -196,7 +196,7 @@ Reflect.defineProperty(HTMLDivElement.prototype, 'setBackground', {
this.style.backgroundSize = 'cover'; this.style.backgroundSize = 'cover';
if (type === 'character') { if (type === 'character') {
const nameinfo = get.character(name); const nameinfo = get.character(name);
const sex = nameinfo ? nameinfo[0] : 'male'; const sex = nameinfo && ['male', 'female', 'double'].includes(nameinfo[0]) ? nameinfo[0] : 'male';
this.setBackgroundImage([ this.setBackgroundImage([
src, src,
`${lib.characterDefaultPicturePath}${sex}${ext}` `${lib.characterDefaultPicturePath}${sex}${ext}`