2
0
mirror of https://github.com/iconify/iconify.git synced 2025-01-23 07:08:34 +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,12 +22,16 @@ export async function getCustomIcon(
debug(`${collection}:${icon}`); debug(`${collection}:${icon}`);
try {
if (typeof custom === 'function') { if (typeof custom === 'function') {
result = await custom(icon); result = await custom(icon);
} else { } else {
const inline = custom[icon]; const inline = custom[icon];
result = typeof inline === 'function' ? await inline() : inline; result = typeof inline === 'function' ? await inline() : inline;
} }
} catch {
return;
}
if (result) { if (result) {
const cleanupIdx = result.indexOf('<svg'); const cleanupIdx = result.indexOf('<svg');