Skip to content

Fix null context issue in CommonsDaggerSupportFragment #6218

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

Merged
merged 2 commits into from
Mar 8, 2025

Conversation

rohit9625
Copy link
Contributor

Description (required)

Fixes #6208

What changes did you make and why?
The override of the context getter in CommonsDaggerSupportFragment was throwing IllegalStateException when trying to access context. Eg:- if(context == null) can also throw an exception in run-time.

So, I removed the getter and refactored the code using this context because getContext() should return null and we check the context before using it.

Tests performed (required)

Tested prodDebug on Samsung A14 with API level 34.

Screenshots (for UI changes only)
None

Refactored related code to resolve build issues
Copy link

github-actions bot commented Mar 3, 2025

✅ Generated APK variants!

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.

Used for a day, seems to be working fine.
Thanks!

@nicolas-raoul nicolas-raoul merged commit 32d485c into commons-app:main Mar 8, 2025
1 check passed
@rohit9625 rohit9625 deleted the fix/null-context branch March 9, 2025 04:44
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 in main: IllegalStateException: Context is null
2 participants