Skip to content

Fix: Fix crash when adding location after removing a picture#6175

Merged
nicolas-raoul merged 4 commits intocommons-app:mainfrom
sonalyadav1:issue-6171
Feb 7, 2025
Merged

Fix: Fix crash when adding location after removing a picture#6175
nicolas-raoul merged 4 commits intocommons-app:mainfrom
sonalyadav1:issue-6171

Conversation

@sonalyadav1
Copy link
Contributor

@sonalyadav1 sonalyadav1 commented Feb 4, 2025

**Description **
This PR fixes a crash that occurs when a user tries to add a location after removing a picture. The crash happens because the ActivityResultLauncher for the LocationPickerActivity is not properly registered before being used.


Fixes #6171

Solution
Added a lateinit var startForResult: ActivityResultLauncher to declare the launcher.
Registered the ActivityResultLauncher in the onCreate method of the fragment.
Ensured the launcher is properly initialized before being used in goToLocationPickerActivity.


Tests performed (required)

Tested {BetaDebugUnit} on {Vivo V25} with API level {34}.


video_20250205_010501_edit.copy.mp4

Copy link
Member

@nicolas-raoul nicolas-raoul left a comment

Choose a reason for hiding this comment

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

Solves the crash, thanks!

@nicolas-raoul nicolas-raoul merged commit e9e2697 into commons-app:main Feb 7, 2025
1 check passed
nicolas-raoul added a commit that referenced this pull request Feb 26, 2025
* Fix: Resolved the Crash in UploadMediaDetailFragment

* Fix uninitialized basicKvStoreFactory in UploadMediaPresenter

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
sonalyadav1 added a commit to sonalyadav1/apps-android-commons that referenced this pull request May 22, 2025
…-app#6175)

* Fix: Resolved the Crash in UploadMediaDetailFragment

* Fix uninitialized basicKvStoreFactory in UploadMediaPresenter

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
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.

[Bug]: crash when trying to add location after picture is removed

2 participants