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

Better NPE handling #530

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

Better NPE handling #530

wants to merge 1 commit into from

Conversation

tom5079
Copy link

@tom5079 tom5079 commented Oct 1, 2020

resolves #529

if (vTranslateBefore == null) { vTranslateBefore = new PointF(0, 0); }
if (vTranslateBefore == null) {
vTranslateBefore = new PointF(vTranslate.x, vTranslate.y);
} else {
Copy link
Author

Choose a reason for hiding this comment

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

I added this part to maintain the exact same behavior as before but I think just assigning a new PointF instance will be enough if you're not worried about the overhead and GC cost

@victorfan336
Copy link

Please save the baby

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.

Attempt to read from field 'float android.graphics.PointF.x' on a null object reference
2 participants