From google play console:
Caused by: java.lang.NullPointerException:
at com.owncloud.android.ui.activity.FileDisplayActivity$DownloadFinishReceiver.onReceive (FileDisplayActivity.java:1432)
which is
getStorageManager().getFileByPath(mWaitingToSend.getRemotePath())
This method can return null if the file does not exist in our database.
We could
This is just an example, there are a lot more functions where we might return null and then have to check with "returnedObject != null".
This is not something we need to address now and should be discussed on case by case.
I can start working on this issue and add commit for each fix case by case
Thanks @tanvidadu, but we should first clarify what do of the 3 options we use.
What would you prefer?
Sometimes it is even acceptable that no file exists already, e.g. in case of creating a folder...
I prefer option FileNotFoundException as it will allow us to take appropriate action as an when required like display an alert etc.
Here we use the null check on purpose...
But for me a real FileNotFoundException is also the best.
@mario @AndyScherzinger your opinions?
If we all agree on this, then @tanvidadu can start :-)
I also agree with you @tanvidadu @tobiasKaminsky -> FileNotFoundException is the appropriate one :+1:
@tanvidadu if you want to start with this, I am happy to help you.
As you said it is the best to have one commit for each case, so in doubt we can just kill one commit.
So this is happening quite some time according to google play console:
mLocalFolder is null and we did not check this...
This functions also needs to be handled better :-)
I will start working on the issue. Is there specific action that needs to be taken while handling exception ?
I think it depends on the case
If you are unsure, just ask here :+1:
Most helpful comment
@tanvidadu if you want to start with this, I am happy to help you.
As you said it is the best to have one commit for each case, so in doubt we can just kill one commit.