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

Check module queue existence when logging #1086

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

elwayman02
Copy link

The current code makes a null check for the module queue before reading its length, but before it does that, it tries to access the length in another line of code. We should consistently make null checks in both places if we expect it's possible the queue could be null. This issue was masked in v6 and earlier, because the first access of length was inside a try-catch block. Upgrading to v7/v8 would causes some test suites to fail out when the module queue comes back as null. While this may indicate an issue, it's clear that the intent of the existing null check was to allow ember-exam to keep operating and not throw if the queue is null. It wouldn't make sense to instead throw for a line of code that's only used for the sake of logging, if we're protecting other parts of the code.

The current code makes a null check for the module queue before reading its length, but before it does that, it tries to access the length in another line of code. We should consistently make null checks in both places if we expect it's possible the queue could be null. This issue was masked in v6 and earlier, because the first access of `length` was inside a try-catch block. Upgrading to v7/v8 would causes some test suites to fail out when the module queue comes back as null. While this may indicate an issue, it's clear that the intent of the existing null check was to allow ember-exam to keep operating and not throw if the queue is null. It wouldn't make sense to instead throw for a line of code that's only used for the sake of logging, if we're protecting other parts of the code.
@elwayman02
Copy link
Author

beta/canary builds are likely failing for unrelated reasons

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.

None yet

1 participant