Skip to content

Commit

Permalink
fix: fallback to original url when transform failed
Browse files Browse the repository at this point in the history
  • Loading branch information
MaikoTan committed Feb 15, 2025
1 parent 151a378 commit 42b2ddd
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions packages/core/src/command.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,17 +96,9 @@ export function apply(ctx: Context, config: Config) {
}

if (config.asset && ctx.assets) {
url = await ctx.booru.imgUrlToAssetUrl(url)
if (!url) {
children.unshift(<i18n path='commands.booru.messages.no-image'></i18n>)
continue
}
url = await ctx.booru.imgUrlToAssetUrl(url) ?? url
} else if (config.base64) {
url = await ctx.booru.imgUrlToBase64(url)
if (!url) {
children.unshift(<i18n path='commands.booru.messages.no-image'></i18n>)
continue
}
url = await ctx.booru.imgUrlToBase64(url) ?? url
}
switch (config.output) {
case OutputType.All:
Expand Down

0 comments on commit 42b2ddd

Please sign in to comment.