Fix undefined reference

This commit is contained in:
Cohee 2024-07-02 00:16:46 +03:00
parent 1315f0968b
commit 39c97f9b89
1 changed files with 1 additions and 1 deletions

View File

@ -803,7 +803,7 @@ export function getImageSizeFromDataURL(dataUrl) {
export function getCharaFilename(chid) { export function getCharaFilename(chid) {
const context = getContext(); const context = getContext();
const fileName = context.characters[chid ?? context.characterId].avatar; const fileName = context.characters[chid ?? context.characterId]?.avatar;
if (fileName) { if (fileName) {
return fileName.replace(/\.[^/.]+$/, ''); return fileName.replace(/\.[^/.]+$/, '');