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

Crash prevention on getScaledScreenshot when rootView is not measured yet #729

Conversation

matteinn
Copy link
Contributor

Fixes #728

Updated ActivityImageUtils.getScaledScreenshot(...) method like this:

  • Added a check on rootView width and height attributes to perform an early exit in case that view is not measured yet
  • Replaced the "// May return null." comment with a proper @nullable annotation so that the compiler will warn about improper nullability handling
  • Added a more explicit comment with reasons why this method may return null

@zihejia zihejia self-requested a review March 25, 2021 03:27
Copy link
Collaborator

@zihejia zihejia left a comment

Choose a reason for hiding this comment

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

Thank you for providing this PR.

@zihejia zihejia merged commit 8639aa2 into mixpanel:master Mar 25, 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.

ActivityImageUtils.getScaledScreenshot crash
2 participants