-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NPE: general enhancements #2223
Comments
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. 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... android/src/main/java/com/owncloud/android/operations/CreateFolderOperation.java Lines 100 to 102 in b6e84b6
@mario @AndyScherzinger your opinions? |
I also agree with you @tanvidadu @tobiasKaminsky -> |
@tanvidadu if you want to start with this, I am happy to help you. |
So this is happening quite some time according to google play console: android/src/main/java/com/owncloud/android/operations/RefreshFolderOperation.java Lines 358 to 364 in c1fe52b
mLocalFolder is null and we did not check this... |
android/src/main/java/com/owncloud/android/ui/activity/ManageAccountsActivity.java Line 116 in d12af2a
This functions also needs to be handled better :-) |
And this... android/src/main/java/com/owncloud/android/ui/activity/FileActivity.java Lines 561 to 572 in b0586ee
|
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 👍 |
#13084 helped with at least one of these (mLocalFolder) |
From google play console:
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.
The text was updated successfully, but these errors were encountered: