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

Prevent access of invalid references #91

Merged
merged 1 commit into from
Jan 21, 2021

Conversation

joaopaulovieira
Copy link
Member

@joaopaulovieira joaopaulovieira commented Jan 6, 2021

Summary

Some calls to this.shakaPlayerInstance.getManifest() are doing before one valid shaka player instance exists. This PR prevents those access to avoid log noises.

Changes

  • Returns null on presentationTimeline getter if this.shakaPlayerInstance.getManifest() doesn't exists;
  • Returns 0 on getProgramDateTime method if this.presentationTimeline returns invalid value;

How to test

  • Play any media;
  • Open console tab of your developers tools;
    • Should not have any console about access presentationTimeline of null.

A picture is worth a thousand words

Before

Screen.Recording.2021-01-06.at.10.27.31.mov

After

Screen.Recording.2021-01-06.at.10.24.51.mov

@joaopaulovieira joaopaulovieira force-pushed the avoid-invalid-references-noise branch from 240b51c to 0caa98a Compare January 21, 2021 19:19
@joaopaulovieira joaopaulovieira merged commit b681132 into master Jan 21, 2021
@joaopaulovieira joaopaulovieira deleted the avoid-invalid-references-noise branch January 21, 2021 19:20
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.

2 participants