Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle uncaught exception during .map file discovery. #39

Merged
merged 1 commit into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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