mirror of
https://github.com/iconify/iconify.git
synced 2024-11-09 14:50:56 +00:00
chore: add try catch to custom loader in utils
This commit is contained in:
parent
8b2af7135a
commit
a7f77a2ac5
@ -22,11 +22,15 @@ export async function getCustomIcon(
|
|||||||
|
|
||||||
debug(`${collection}:${icon}`);
|
debug(`${collection}:${icon}`);
|
||||||
|
|
||||||
if (typeof custom === 'function') {
|
try {
|
||||||
result = await custom(icon);
|
if (typeof custom === 'function') {
|
||||||
} else {
|
result = await custom(icon);
|
||||||
const inline = custom[icon];
|
} else {
|
||||||
result = typeof inline === 'function' ? await inline() : inline;
|
const inline = custom[icon];
|
||||||
|
result = typeof inline === 'function' ? await inline() : inline;
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result) {
|
if (result) {
|
||||||
|
Loading…
Reference in New Issue
Block a user