Skip to content

Commit

Permalink
fix: error upon switching projects fast
Browse files Browse the repository at this point in the history
  • Loading branch information
solvedDev committed Sep 8, 2022
1 parent 09f0005 commit 868aee2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/components/Data/TypeLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,13 @@ export class TypeLoader {
const app = await App.getApp()

await app.project.packIndexer.fired
const allFiles = await app.project.packIndexer.service.getAllFiles()
let allFiles
try {
allFiles = await app.project.packIndexer.service.getAllFiles()
} catch {
// We failed to access the pack indexer service -> fail silently
return
}

const typeScriptFiles = allFiles.filter(
(filePath) => filePath.endsWith('.ts') || filePath.endsWith('.js')
Expand Down

0 comments on commit 868aee2

Please sign in to comment.