Skip to content

Commit

Permalink
Handle uncaught exception during .map file discovery. (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
chmeyer-ms authored Sep 20, 2023
1 parent e6eb40c commit 9a5c643
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,7 @@
## Version 1.1.0 (June 2023)

- Fix ignored 'stop' event, which caused missing variables and stack frame.

## Version 1.1.1 (September 2023)

- Handle uncaught exceptions during .map file discovery against invalid directory. Write to log and pop notification message.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "minecraft-debugger",
"displayName": "Minecraft Bedrock Edition Debugger",
"description": "Debug your JavaScript code running as part of the GameTest Framework experimental feature in Minecraft Bedrock Edition.",
"version": "1.1.0",
"version": "1.1.1",
"publisher": "mojang-studios",
"author": {
"name": "Mojang Studios"
Expand Down
13 changes: 9 additions & 4 deletions src/Session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -615,12 +615,17 @@ export class Session extends DebugSession {
if (!filePath || !extensions) {
return false;
}
let fileNames = fs.readdirSync(filePath);
for (let fn of fileNames) {
if (extensions.some(ext => fn.endsWith(ext))) {
return true;
try {
let fileNames = fs.readdirSync(filePath);
for (let fn of fileNames) {
if (extensions.some(ext => fn.endsWith(ext))) {
return true;
}
}
}
catch (e) {
this.log((e as Error).message, LogLevel.Error);
}
return false;
}

Expand Down

0 comments on commit 9a5c643

Please sign in to comment.