Fix undefined reference
| @@ -803,7 +803,7 @@ export function getImageSizeFromDataURL(dataUrl) { | |||
| 803 | 803 | ||
| 804 | export function getCharaFilename(chid) { | 804 | export function getCharaFilename(chid) { |
| 805 | const context = getContext(); | 805 | const context = getContext(); |
| 806 | const fileName = context.characters[chid ?? context.characterId].avatar; | 806 | const fileName = context.characters[chid ?? context.characterId]?.avatar; |
| 807 | 807 | ||
| 808 | if (fileName) { | 808 | if (fileName) { |
| 809 | return fileName.replace(/\.[^/.]+$/, ''); | 809 | return fileName.replace(/\.[^/.]+$/, ''); |