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 crash when aspectRatio is null. #3561

Merged
merged 2 commits into from
Sep 30, 2024
Merged

Conversation

bmarty
Copy link
Member

@bmarty bmarty commented Sep 30, 2024

Content

Rule number one: never use !! or you will provoke the wrath of the Kotlin God :).
This PR fixes a crash when the aspectRatio is unknown (and so null).
Add screenshot to cover this case, but strangely the preview was rendered before the fix (not correctly but without crashing).

Motivation and context

Closes #3552 (confirmed it fixes the issue)

Screenshots / GIFs

Before: crash
After:
image

Tests

  • Step 1
  • Step 2
  • Step ...

Tested devices

  • Physical
  • Emulator
  • OS version(s):

Checklist

  • Changes have been tested on an Android device or Android emulator with API 23
  • UI change has been tested on both light and dark themes
  • Accessibility has been taken into account. See https://github.com/element-hq/element-x-android/blob/develop/CONTRIBUTING.md#accessibility
  • Pull request is based on the develop branch
  • Pull request title will be used in the release note, it clearly define what will change for the user
  • Pull request includes screenshots or videos if containing UI changes
  • Pull request includes a sign off
  • You've made a self review of your PR

@bmarty bmarty requested a review from a team as a code owner September 30, 2024 08:06
@bmarty bmarty requested review from jmartinesp and removed request for a team September 30, 2024 08:06
@bmarty bmarty added the PR-Bugfix For bug fix label Sep 30, 2024
Copy link

sonarcloud bot commented Sep 30, 2024

Copy link
Contributor

📱 Scan the QR code below to install the build (arm64 only) for this PR.
QR code
If you can't scan the QR code you can install the build via this link: https://i.diawi.com/UA8mCm

Copy link

codecov bot commented Sep 30, 2024

Codecov Report

Attention: Patch coverage is 88.88889% with 1 line in your changes missing coverage. Please review.

Project coverage is 82.68%. Comparing base (148da7b) to head (6a8086c).
Report is 3 commits behind head on develop.

Files with missing lines Patch % Lines
...meline/components/event/TimelineItemStickerView.kt 50.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #3561   +/-   ##
========================================
  Coverage    82.68%   82.68%           
========================================
  Files         1732     1732           
  Lines        40970    40974    +4     
  Branches      4962     4964    +2     
========================================
+ Hits         33874    33879    +5     
  Misses        5341     5341           
+ Partials      1755     1754    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@jmartinesp jmartinesp left a comment

Choose a reason for hiding this comment

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

I humbly ask forgiveness from the mighty Kotlin God 🙏 .

Thanks for fixing the issue!

@bmarty bmarty added the Run-Maestro Starts a Maestro Cloud session to run integration tests label Sep 30, 2024
@github-actions github-actions bot removed the Run-Maestro Starts a Maestro Cloud session to run integration tests label Sep 30, 2024
@bmarty bmarty merged commit 96fae1b into develop Sep 30, 2024
34 checks passed
@bmarty bmarty deleted the feature/bma/fixAspectRatioIssue branch September 30, 2024 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR-Bugfix For bug fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Specific video message blow up the app
3 participants