mirror of
https://github.com/iconify/iconify.git
synced 2025-01-05 15:02:09 +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}`);
|
||||
|
||||
if (typeof custom === 'function') {
|
||||
result = await custom(icon);
|
||||
} else {
|
||||
const inline = custom[icon];
|
||||
result = typeof inline === 'function' ? await inline() : inline;
|
||||
try {
|
||||
if (typeof custom === 'function') {
|
||||
result = await custom(icon);
|
||||
} else {
|
||||
const inline = custom[icon];
|
||||
result = typeof inline === 'function' ? await inline() : inline;
|
||||
}
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
|
||||
if (result) {
|
||||
|
Loading…
Reference in New Issue
Block a user