增加WASM的调用错误防御。
This commit is contained in:
parent
22755fa60a
commit
05bceaeb06
|
@ -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 (
|
||||
|
|
Loading…
Reference in New Issue
Block a user