Fix image not appending

This commit is contained in:
kwaroran
2024-03-28 01:24:50 +09:00
parent dbaa2968cc
commit 9f0a8f38b5

View File

@@ -79,7 +79,7 @@ async function importCharacterProcess(f:{
for await (const chunk of readGenerator){ for await (const chunk of readGenerator){
console.log(chunk) console.log(chunk)
if(!chunk){ if(!chunk){
break continue
} }
if(chunk instanceof AppendableBuffer){ if(chunk instanceof AppendableBuffer){
img = chunk.buffer img = chunk.buffer
@@ -90,7 +90,7 @@ async function importCharacterProcess(f:{
if(readedChara.length < 2 * 1024 * 1024){ if(readedChara.length < 2 * 1024 * 1024){
readedChara = chunk.value.replaceAll('\0', '') readedChara = chunk.value.replaceAll('\0', '')
} }
break continue
} }
if(chunk.key.startsWith('chara-ext-asset_')){ if(chunk.key.startsWith('chara-ext-asset_')){
const assetIndex = (chunk.key.replace('chara-ext-asset_', '')) const assetIndex = (chunk.key.replace('chara-ext-asset_', ''))
@@ -105,6 +105,12 @@ async function importCharacterProcess(f:{
return return
} }
if(!img){
console.error("No Image Found")
alertError(language.errors.noData)
return
}
if(readedChara.startsWith('rcc||')){ if(readedChara.startsWith('rcc||')){
const parts = readedChara.split('||') const parts = readedChara.split('||')
const type = parts[1] const type = parts[1]