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

when this.stats is called, add optional chaining or check for existence #6459

Merged
merged 8 commits into from
May 31, 2024

Conversation

xta
Copy link
Contributor

@xta xta commented May 29, 2024

This PR will...

add optional chaining or check for existence to handle cases where this.stats is null

Why is this Pull Request needed?

See discussion #6201 (comment)

Are there any points in the code the reviewer needs to double check?

I didn't want to modify every this.stats. in src/utils/xhr-loader.ts. Just the parts where I was running into TypeError: Cannot read properties of null

I made some changes since I was also seeing these errors:

loaded error retry error

Resolves issues:

This PR resolves my issues in #6201

Checklist

  • changes have been done against master branch, and PR does not conflict
  • new unit / functional tests have been added (whenever applicable)
  • API or design changes are documented in API.md

src/utils/xhr-loader.ts Outdated Show resolved Hide resolved
src/utils/xhr-loader.ts Outdated Show resolved Hide resolved
src/utils/xhr-loader.ts Outdated Show resolved Hide resolved
src/utils/xhr-loader.ts Outdated Show resolved Hide resolved
@robwalch robwalch modified the milestone: 1.5.9 May 29, 2024
xta and others added 2 commits May 29, 2024 14:55
Co-authored-by: Rob Walch <robwalch@users.noreply.github.com>
Co-authored-by: Rob Walch <robwalch@users.noreply.github.com>
@robwalch robwalch added this to the 1.5.10 milestone May 29, 2024
@xta xta requested a review from robwalch May 30, 2024 19:18
@robwalch robwalch modified the milestones: 1.5.10, 1.6.0 May 31, 2024
@robwalch
Copy link
Collaborator

Marking for 1.6.0 as this PR is against master. I'll open another PR with this change cherry-picked for 1.5.10.

@robwalch robwalch merged commit f379442 into video-dev:master May 31, 2024
4 checks passed
@xta
Copy link
Contributor Author

xta commented May 31, 2024

thanks @robwalch! 🚀

robwalch pushed a commit that referenced this pull request May 31, 2024
robwalch added a commit that referenced this pull request Jun 1, 2024
* patch/v1.5.x:
  Don't append over first fragment when next fragment aligns with playlist within 1/200s tolerance (#6471)
  Fix exception reading metadata.channelCount with HE-AAC when changeType is not supported (#6472)
  Fix TSDemuxer parsing error handling in sync path (#6469)
  when `this.stats` is called, add optional chaining or check for existence (#6459)
@robwalch robwalch modified the milestones: 1.6.0, 1.5.10 Jun 3, 2024
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.

How to prevent an error that xhrSetup throws after package migration to v1.5.0?
2 participants