Skip to content

Commit fd637d5

Browse files
authored
Merge pull request #603 from HashLips/dev
Updated
2 parents b005c44 + cdf0c66 commit fd637d5

2 files changed

Lines changed: 11 additions & 7 deletions

File tree

.github/feature_request.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ labels: enhancement
1414

1515
### Motivation
1616

17-
<!-- Why are we doing this? What use cases does it support? What is the expected outcome? -->
17+
<!-- Why are we doing this? What use cases does it support? What is the expected outcome? -->

src/main.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -177,13 +177,17 @@ const addAttributes = (_element) => {
177177
};
178178

179179
const loadLayerImg = async (_layer) => {
180-
if (_layer.selectedElement.path.includes("-")) {
181-
throw new Error("layer name can not contain dashes");
180+
try {
181+
if (_layer.selectedElement.path.includes("-")) {
182+
throw new Error("layer name can not contain dashes");
183+
}
184+
return new Promise(async (resolve) => {
185+
const image = await loadImage(`${_layer.selectedElement.path}`);
186+
resolve({ layer: _layer, loadedImage: image });
187+
});
188+
} catch (error) {
189+
console.error("Error loading image:", error);
182190
}
183-
return new Promise(async (resolve) => {
184-
const image = await loadImage(`${_layer.selectedElement.path}`);
185-
resolve({ layer: _layer, loadedImage: image });
186-
});
187191
};
188192

189193
const addText = (_sig, x, y, size) => {

0 commit comments

Comments
 (0)