增加WASM的调用错误防御。
This commit is contained in:
parent
22755fa60a
commit
05bceaeb06
@ -62,6 +62,7 @@ export function ColorStand({ title, color }: ColorStandProps) {
|
|||||||
if (isNil(color)) {
|
if (isNil(color)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
try {
|
||||||
switch (viewColor) {
|
switch (viewColor) {
|
||||||
case 'hex':
|
case 'hex':
|
||||||
return color;
|
return color;
|
||||||
@ -84,6 +85,10 @@ export function ColorStand({ title, color }: ColorStandProps) {
|
|||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.error('[ColorStand Convert]', e);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}, [viewColor, color]);
|
}, [viewColor, color]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user