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

Use Objects.requireNonNull(). #5254

Merged

Conversation

Isira-Seneviratne
Copy link
Member

@Isira-Seneviratne Isira-Seneviratne commented Dec 23, 2020

What is it?

  • Bugfix (user facing)
  • Feature (user facing)
  • Codebase improvement (dev facing)
  • Meta improvement to the project (dev facing)

Description of the changes in your PR

  • Use Objects.requireNonNull() to ensure null safety instead of throwing NullPointerExceptions manually.

APK testing

debug.zip

Due diligence

Copy link
Member

@TobiGr TobiGr left a comment

Choose a reason for hiding this comment

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

Thanks. Changes look good.

I think it makes sense to have the null checks at the beginning of a method to not execute code unnecessarily.

@Stypox
Copy link
Member

Stypox commented Dec 23, 2020

I'd also remove some strings which are Objects.requireNonNull() parameters, when they don't tell anything about what caused the issue that would be easily extracted from the exception. what do you think @TobiGr ?

@TobiGr
Copy link
Member

TobiGr commented Dec 23, 2020

@Stypox Sounds good

@Redirion Redirion merged commit e75ef08 into TeamNewPipe:dev Jan 2, 2021
@Isira-Seneviratne Isira-Seneviratne deleted the Use_Objects_requireNonNull branch January 9, 2021 09:17
This was referenced Jan 18, 2021
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.

5 participants