Skip to content

Conversation

@tobiasKaminsky
Copy link
Member

Found via google play console:

Caused by: java.lang.NullPointerException: 
  at com.owncloud.android.ui.activity.FileDisplayActivity$DownloadFinishReceiver.onReceive (FileDisplayActivity.java:1493)
  at android.app.LoadedApk$ReceiverDispatcher$Args.lambda$-android_app_LoadedApk$ReceiverDispatcher$Args_52225 (LoadedApk.java:1319)

if (mWaitingToSend != null) {
mWaitingToSend = getStorageManager().getFileByPath(mWaitingToSend.getRemotePath());
if (mWaitingToSend.isDown() && downloadBehaviour != null) {

The file gets refreshed because metadata could have changed.
Somehow then storageManager cannot find it anylonger.
(mWaitingToSend is not null, as this would produce an IllegalArgumentException).
So my assumption is that somehow the the remote path is changed and thus the file cannot be found anymore.
--> remoteId stays the same, so it is better to use.

Additionally, I added a null check, so that in doubt nothing happens, but at least also do not crash.

Signed-off-by: tobiasKaminsky tobias@kaminsky.me

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
@nextcloud-android-bot
Copy link
Collaborator

Lint

96 warnings

FindBugs (new)

Warning TypeNumber
Bad practice Warnings35
Correctness Warnings166
Experimental Warnings4
Internationalization Warnings12
Malicious code vulnerability Warnings9
Multithreaded correctness Warnings9
Performance Warnings158
Security Warnings163
Dodgy code Warnings209
Total765

FindBugs (master)

Warning TypeNumber
Bad practice Warnings35
Correctness Warnings166
Experimental Warnings4
Internationalization Warnings12
Malicious code vulnerability Warnings9
Multithreaded correctness Warnings9
Performance Warnings158
Security Warnings163
Dodgy code Warnings209
Total765

@codecov
Copy link

codecov bot commented Jun 29, 2018

Codecov Report

Merging #2776 into master will increase coverage by <.01%.
The diff coverage is 0%.

@@            Coverage Diff            @@
##           master   #2776      +/-   ##
=========================================
+ Coverage    6.37%   6.38%   +<.01%     
=========================================
  Files         294     294              
  Lines       29563   29569       +6     
  Branches     4268    4269       +1     
=========================================
+ Hits         1885    1888       +3     
- Misses      27389   27394       +5     
+ Partials      289     287       -2
Impacted Files Coverage Δ
...cloud/android/ui/activity/FileDisplayActivity.java 0% <0%> (ø) ⬆️
...loud/android/datamodel/FileDataStorageManager.java 10.52% <0%> (-0.06%) ⬇️
...in/java/com/owncloud/android/datamodel/OCFile.java 63.32% <0%> (+1.15%) ⬆️

@AndyScherzinger
Copy link
Member

AndyScherzinger commented Jun 29, 2018

👍

Approved with PullApprove

AndyScherzinger added a commit that referenced this pull request Jul 4, 2018
Backport of #2776: update file via remote id
@mario
Copy link
Contributor

mario commented Jul 12, 2018

👍

Approved with PullApprove

@AndyScherzinger AndyScherzinger merged commit e35124d into master Jul 12, 2018
@AndyScherzinger AndyScherzinger deleted the fileByRemoteId branch July 12, 2018 16:12
@AndyScherzinger AndyScherzinger added this to the Nextcloud App 3.3.0 milestone Jul 12, 2018
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.

5 participants