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

RUMM-3774 prevent crash in Canvas Wrapper #1954

Merged
merged 1 commit into from Mar 29, 2024

Conversation

xgouchet
Copy link
Collaborator

What does this PR do?

This PR adds several checks to ensure the bitmap can be used in a canvas.

Fixes #1952

@xgouchet xgouchet requested review from a team as code owners March 29, 2024 13:46
return null
}

@Suppress("TooGenericExceptionCaught")
return try {
Canvas(bitmap)
} catch (e: IllegalStateException) {
Copy link
Contributor

Choose a reason for hiding this comment

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

minor: the comment on the line below should be updated to should never happen since we are passing a mutable bitmap

@codecov-commenter
Copy link

codecov-commenter commented Mar 29, 2024

Codecov Report

Merging #1954 (0b607b4) into develop (736e81c) will decrease coverage by 0.06%.
Report is 3 commits behind head on develop.
The diff coverage is 66.67%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1954      +/-   ##
===========================================
- Coverage    83.19%   83.13%   -0.06%     
===========================================
  Files          486      486              
  Lines        17560    17546      -14     
  Branches      2603     2601       -2     
===========================================
- Hits         14609    14586      -23     
- Misses        2249     2254       +5     
- Partials       702      706       +4     
Files Coverage Δ
...replay/internal/recorder/wrappers/CanvasWrapper.kt 28.00% <66.67%> (+12.21%) ⬆️

... and 29 files with indirect coverage changes

@xgouchet xgouchet merged commit 2f83078 into develop Mar 29, 2024
23 checks passed
@xgouchet xgouchet deleted the xgouchet/RUM-3774/crash_drawable_utils branch March 29, 2024 15:01
@xgouchet xgouchet added this to the 2.8.x milestone Apr 5, 2024
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.

Crash generated by DrawableUtils
3 participants