Skip to content

Conversation

@ezaquarii
Copy link
Collaborator

@ezaquarii ezaquarii commented Sep 28, 2019

Fragment can be detached when async task finishes.
Detached fragment has no context and getString() fails with NPE.

Fixes #4582

Signed-off-by: Chris Narkiewicz hello@ezaquarii.com

@ezaquarii ezaquarii force-pushed the ezaquarii/fix-npe-in-preview-media-fragment branch from 61a6385 to c660ca7 Compare September 28, 2019 22:16
@nextcloud nextcloud deleted a comment Sep 28, 2019
@nextcloud nextcloud deleted a comment Sep 28, 2019
@ezaquarii
Copy link
Collaborator Author

@tobiasKaminsky @AndyScherzinger
It will be fixed by #4208, but this little fix should go into 3.8 IMO.

Fragment can be detached before async task finishes.
Detached fragment has no context and getString() fails with NPE.

Fixes #4412

Signed-off-by: Chris Narkiewicz <hello@ezaquarii.com>
@ezaquarii ezaquarii force-pushed the ezaquarii/fix-npe-in-preview-media-fragment branch from c1b0aa9 to 488193a Compare September 28, 2019 22:41
@nextcloud nextcloud deleted a comment Sep 28, 2019
@nextcloud nextcloud deleted a comment Sep 28, 2019
@AndyScherzinger AndyScherzinger added this to the Nextcloud App 3.8.1 milestone Oct 1, 2019
@AndyScherzinger
Copy link
Member

/backport to stable-3.8

@tobiasKaminsky
Copy link
Member

Thanks for the finding!

@nextcloud-android-bot
Copy link
Collaborator

APK file: https://www.kaminsky.me/nc-dev/android-artifacts/11062.apk

qrcode

To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app.

@nextcloud-android-bot
Copy link
Collaborator

Codacy

273

Lint

TypemasterPR
Warnings5959
Errors00

SpotBugs (new)

Warning TypeNumber
Bad practice Warnings27
Correctness Warnings69
Internationalization Warnings12
Malicious code vulnerability Warnings4
Multithreaded correctness Warnings9
Performance Warnings120
Security Warnings47
Dodgy code Warnings139
Total427

SpotBugs (master)

Warning TypeNumber
Bad practice Warnings27
Correctness Warnings69
Internationalization Warnings12
Malicious code vulnerability Warnings4
Multithreaded correctness Warnings9
Performance Warnings120
Security Warnings47
Dodgy code Warnings139
Total427

@codecov
Copy link

codecov bot commented Oct 2, 2019

Codecov Report

Merging #4577 into master will increase coverage by 0.2%.
The diff coverage is 0%.

@@            Coverage Diff             @@
##             master   #4577     +/-   ##
==========================================
+ Coverage     16.99%   17.2%   +0.2%     
  Complexity        3       3             
==========================================
  Files           365     375     +10     
  Lines         32093   33424   +1331     
  Branches       4519    4902    +383     
==========================================
+ Hits           5454    5750    +296     
- Misses        25748   26752   +1004     
- Partials        891     922     +31
Impacted Files Coverage Δ Complexity Δ
...cloud/android/ui/preview/PreviewMediaFragment.java 0% <0%> (ø) 0 <0> (ø) ⬇️
...c/main/java/com/nextcloud/client/di/AppModule.java 67.44% <0%> (-5.29%) 0% <0%> (ø)
...ncloud/android/datamodel/SyncedFolderProvider.java 10.32% <0%> (-0.89%) 0% <0%> (ø)
...n/java/com/owncloud/android/jobs/FilesSyncJob.java 0% <0%> (ø) 0% <0%> (ø) ⬇️
...a/com/owncloud/android/media/MediaControlView.java 0% <0%> (ø) 0% <0%> (ø) ⬇️
...n/java/com/nextcloud/client/media/PlayerService.kt 0% <0%> (ø) 0% <0%> (?)
...a/com/nextcloud/client/media/PlayerStateMachine.kt 95.31% <0%> (ø) 0% <0%> (?)
...ain/java/com/nextcloud/client/media/ErrorFormat.kt 0% <0%> (ø) 0% <0%> (?)
...in/java/com/nextcloud/client/media/PlaylistItem.kt 0% <0%> (ø) 0% <0%> (?)
... and 11 more

@tobiasKaminsky tobiasKaminsky merged commit b204db0 into master Oct 2, 2019
@delete-merged-branch delete-merged-branch bot deleted the ezaquarii/fix-npe-in-preview-media-fragment branch October 2, 2019 07:02
@backportbot-nextcloud
Copy link

backport to stable-3.8 in #4594

tobiasKaminsky added a commit that referenced this pull request Oct 3, 2019
59e1f7f Merge pull request #4357 from nextcloud/changeDroneOrder
c9e9fe1 Merge pull request #4597 from nextcloud/buildAgain
7ebc88d make build run again
4f15e87 Merge pull request #4592 from nextcloud/parentCheck
b204db0 Merge pull request #4577 from nextcloud/ezaquarii/fix-npe-in-preview-media-fragment
9876c49 Merge pull request #4415 from nextcloud/dependabot/gradle/io.gitlab.arturbosch.detekt-detekt-gradle-plugin-1.0.1
9a580b3 Merge pull request #4591 from nextcloud/dependabot/gradle/org.mockito-mockito-core-3.1.0
f6e24eb if parent is null, then do a regular check, no early exit
0dfdc6a Bump mockito-core from 3.0.0 to 3.1.0
9133158 [tx-robot] updated from transifex
7d8474e daily dev 20191002
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error repoducion video android

5 participants