Skip to content

Commit c0de60a

Browse files
committed
fix: 🐛 Added basic error handling for path error
When a user creates a file with a dash the app breaks. This change lets the user know that you can not use dashes in file names.
1 parent 304fcfc commit c0de60a

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/main.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,10 @@ 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');
182+
}
183+
180184
return new Promise(async (resolve) => {
181185
const image = await loadImage(`${_layer.selectedElement.path}`);
182186
resolve({ layer: _layer, loadedImage: image });

0 commit comments

Comments
 (0)