Skip to content

Conversation

@Inuth0603
Copy link
Contributor

Summary

This PR fixes a crash (NullPointerException) that occurred when the MediaWiki API returned malformed error JSON (e.g., when trying to edit Depicts).

Changes

  1. Fix Crash: Added try-catch blocks and null checks in the response interceptor to handle parsing errors safely without crashing the app.
  2. Refactor: Extracted the private UnsuccessfulResponseInterceptor from OkHttpConnectionFactory.kt into its own public file named CommonsResponseInterceptor.kt.
    • This fixes visibility issues that prevented proper unit testing.
    • Renamed the class to CommonsResponseInterceptor for clarity.
  3. Tests: Updated unit tests to verify that malformed JSON no longer causes a crash.

Related Issue

Fixes #6593

@Inuth0603
Copy link
Contributor Author

I noticed the pull_request_unrelated_changes check failed with HttpError: Resource not accessible by integration.

This seems to be a permissions issue because I am submitting this PR from a fork (Action does not have write access). I haven't modified the workflow file to keep this PR clean, but let me know if you need me to update the workflow permissions."

@github-actions
Copy link

github-actions bot commented Jan 3, 2026

✅ Generated APK variants!

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 edit depicts

1 participant