增加WASM的调用错误防御。

This commit is contained in:
徐涛 2024-12-30 14:47:21 +08:00
parent 22755fa60a
commit 05bceaeb06

View File

@ -62,6 +62,7 @@ export function ColorStand({ title, color }: ColorStandProps) {
if (isNil(color)) {
return null;
}
try {
switch (viewColor) {
case 'hex':
return color;
@ -84,6 +85,10 @@ export function ColorStand({ title, color }: ColorStandProps) {
default:
return null;
}
} catch (e) {
console.error('[ColorStand Convert]', e);
return null;
}
}, [viewColor, color]);
return (