2
0
mirror of https://github.com/iconify/iconify.git synced 2024-09-19 00:39:02 +00:00

chore: add try catch to custom loader in utils

This commit is contained in:
Vjacheslav Trushkin 2023-08-12 18:59:21 +03:00
parent 8b2af7135a
commit a7f77a2ac5

View File

@ -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) {