NPE: general enhancements
- Dominant language
- Kotlin
- Stars
- 5.6k
- Forks
- 2k
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 92
Description
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
- add @Nullable to method declaration
- throw IllegalArgumentException, which does not need to be handled
- throw FileNotFoundException, which needs to be handled
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.
Contributor guide
Assessment
This issue has not been assessed yet.