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

fix(Android): do not crash in case background can not be casted to MaterialShapeDrawable #2388

Merged
merged 1 commit into from
Oct 4, 2024

Conversation

kkafar
Copy link
Member

@kkafar kkafar commented Oct 4, 2024

Description

It turns out, that this check: b2dab78 was necessary,
and I forgot about it while applying the code review.

Current code will crash if background != null && !(background is MaterialShapeDrawable), so e.g. when background is ColorDrawable.
We don't wanna fail in this case.

Changes

Allowed the cast to fail instead of throwing exception, when casting background to MaterialShapeDrawable.
One thing that concerns me

Test code and steps to reproduce

Test1649

Checklist

  • Included code example that can be used to test this change
  • Ensured that CI passes

@kkafar kkafar merged commit c5d1d51 into main Oct 4, 2024
4 checks passed
@kkafar kkafar deleted the @kkafar/fix-on-sheet-corner-radius branch October 4, 2024 12:49
ja1ns pushed a commit to WiseOwlTech/react-native-screens that referenced this pull request Oct 9, 2024
…terialShapeDrawable (software-mansion#2388)

## Description

It turns out, that this check:
software-mansion@b2dab78
was necessary,
and I forgot about it while applying the code review.

Current code will crash if `background != null && !(background is
MaterialShapeDrawable)`, so e.g. when `background is ColorDrawable`.
We don't wanna fail in this case.

## Changes

Allowed the cast to fail instead of throwing exception, when casting
background to `MaterialShapeDrawable`.
One thing that concerns me 

## Test code and steps to reproduce

`Test1649`

## Checklist

- [ ] Included code example that can be used to test this change
- [ ] Ensured that CI passes
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.

1 participant