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

Update xhr-loader.ts #6359

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ReactWithRajesh
Copy link

@ReactWithRajesh ReactWithRajesh commented Apr 16, 2024

This Line have issue it's throwing error while run time

This PR will... resolve the error while run time

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

Resolves issues: xhrLoader issue

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

This Line have issue it's throwing error while run time
@robwalch
Copy link
Collaborator

Can you provide steps to reproduce?

This Line have issue it's throwing error while run time

That is TypeScript. It is not intended for runtime.

this.callbacks!.onError(
this.callbacks.onError(
Copy link
Collaborator

@robwalch robwalch Apr 16, 2024

Choose a reason for hiding this comment

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

The ! is a TypeScript non-null assertion operator. It is not runtime code. This code must be converted from TS to JS before it is run.

this.callbacks! appears twice in this file. If we decide to remove the non-null assertions, we must remove both, and add null checks before them, like } else if (this.callbacks) { or if (!this.callbacks) { return; } for example.

Copy link
Author

Choose a reason for hiding this comment

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

This is Throwing Error as OnError on xhrrequest

Copy link
Author

Choose a reason for hiding this comment

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

I am using hls as multipalyer and controlling all through a common controller

Copy link
Collaborator

@robwalch robwalch May 3, 2024

Choose a reason for hiding this comment

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

If you want to remove the non-null assertions, you must remove both, and add null checks before each of them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants