Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
Client
Client
  • Project
    • Project
    • Details
    • Activity
    • Releases
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
    • Locked Files
  • Issues 266
    • Issues 266
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 7
    • Merge Requests 7
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Wiki
    • Wiki
  • External Wiki
    • External Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • F-Droid
  • ClientClient
  • Merge Requests
  • !58

Merged
Opened Mar 12, 2015 by Romain Vimont@rom1v
  • Report abuse
Report abuse

Do not manually call onChange() (fix NPE)

If the AppDetails activity has been destroyed by the system during an application installation/remove, it is recreated once it should be displayed again (this behavior can be forced by enabling "Don't keep activities" in Android developer options).

In onCreate(), it passes its instance of myInstallerCallback to an Installer. In onActivityResult() (which is called before onResume()), this installer calls a method (onSuccess() or onError()) on this callback. The implementation of these methods (the anonymous inner class assigned to myInstallerCallback) dereference myAppObserver, which is still null, because it will be initialized in onResume(), so a NullPointerException is thrown.

However, the problem is not only that myAppObserver.onChange() is called when myAppObserver is null, but that it should not be called manually at all: it is a ContentObserver, so it is automatically called when registered to the content resolver. As a consequence, this callback was called twice.

Removing these calls fix both problems.

Should fix issue #135 (closed) #135 (closed)

Check out, review, and merge locally

Step 1. Fetch and check out the branch for this merge request

git fetch https://gitlab.com/rom1v/fdroidclient.git npe_135
git checkout -b rom1v/fdroidclient-npe_135 FETCH_HEAD

Step 2. Review the changes locally

Step 3. Merge the branch and fix any conflicts that come up

git fetch origin
git checkout origin/master
git merge --no-ff rom1v/fdroidclient-npe_135

Step 4. Push the result of the merge to GitLab

git push origin master

Note that pushing to GitLab requires write access to this repository.

Tip: You can also checkout merge requests locally by following these guidelines.

  • Discussion 4
  • Commits 5
  • Changes
Assignee
No assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
0
Labels
None
Assign labels
  • View project labels
Reference: fdroid/fdroidclient!58