Skip to content

Commit 43d3812

Browse files
yann300Aniket-Engg
authored andcommitted
Check if workspace exists
1 parent f95372e commit 43d3812

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

apps/remix-ide/src/app/files/workspaceFileProvider.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ class WorkspaceFileProvider extends FileProvider {
1212

1313
try {
1414
// make sure "code-sample" has been removed
15-
window.remixFileSystem.unlink(this.workspacesPath + '/code-sample')
15+
window.remixFileSystem.exist(this.workspacesPath + '/code-sample').then((exist) => {
16+
if (exist) window.remixFileSystem.unlink(this.workspacesPath + '/code-sample').catch((e) => {
17+
console.log(e)
18+
})
19+
})
1620
} catch (e) {
1721
// we don't need to log error if this throws an error
1822
}

0 commit comments

Comments
 (0)