Skip to content

Conversation

@rohit9625
Copy link
Collaborator

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
@github-actions
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
sonalyadav1 pushed a commit to sonalyadav1/apps-android-commons that referenced this pull request May 22, 2025
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