0
Fork 0
mirror of https://github.com/penpot/penpot-plugins.git synced 2025-01-06 14:50:21 -05:00

fix(icons-plugin): fix typing problem

This commit is contained in:
alonso.torres 2024-06-24 11:10:53 +02:00 committed by Alonso Torres
parent 018c29e244
commit 2ba873f2cd

View file

@ -12,10 +12,13 @@ penpot.ui.onMessage<PluginUIEvent>((message) => {
if (!svg || !name) {
return;
}
const icon = penpot.createShapeFromSvg(svg);
icon.name = name;
icon.x = penpot.viewport.center.x;
icon.y = penpot.viewport.center.y;
if (icon) {
icon.name = name;
icon.x = penpot.viewport.center.x;
icon.y = penpot.viewport.center.y;
}
}
});