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

fix: Add guard for null stack from tracekit. #442

Merged
merged 2 commits into from
Jan 16, 2025
Merged

Conversation

wolfgangcodes
Copy link
Contributor

@wolfgangcodes wolfgangcodes commented Jan 15, 2025

Which problem is this PR solving?

Short description of the changes

Adds a guard for stack === null from tracekit. Also added unit test.

@wolfgangcodes wolfgangcodes changed the title Add guard for null stack from tracekit. fix: Add guard for null stack from tracekit. Jan 16, 2025
@wolfgangcodes wolfgangcodes marked this pull request as ready for review January 16, 2025 16:42
@wolfgangcodes wolfgangcodes requested a review from a team as a code owner January 16, 2025 16:42
@@ -30,12 +30,16 @@ export function getStructuredStackTrace(error: Error | undefined) {
const functions: string[] = [];
const urls: string[] = [];

for (const stackFrame of structuredStack) {
if (!structuredStack) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: If we want to be extra safe here we might also want to check that structuredStack is iterable.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯
28a6ac4

@wolfgangcodes wolfgangcodes merged commit 4d72490 into main Jan 16, 2025
14 checks passed
@wolfgangcodes wolfgangcodes deleted the wg/not-iterable branch January 16, 2025 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"is not iterable" error in GlobalErrorsInstrumentation._computeStackTrace
3 participants