mirror of
https://github.com/moparisthebest/k-9
synced 2024-12-25 17:18:50 -05:00
fixed very rare NullPointerException
This commit is contained in:
parent
724b6eaaa5
commit
59399506df
@ -72,7 +72,14 @@ public class AttachmentProvider extends ContentProvider {
|
|||||||
* We use the cache dir as a temporary directory (since Android doesn't give us one) so
|
* We use the cache dir as a temporary directory (since Android doesn't give us one) so
|
||||||
* on startup we'll clean up any .tmp files from the last run.
|
* on startup we'll clean up any .tmp files from the last run.
|
||||||
*/
|
*/
|
||||||
File[] files = getContext().getCacheDir().listFiles();
|
final File cacheDir = getContext().getCacheDir();
|
||||||
|
if (cacheDir == null) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
File[] files = cacheDir.listFiles();
|
||||||
|
if (files == null) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
for (File file : files) {
|
for (File file : files) {
|
||||||
if (file.getName().endsWith(".tmp")) {
|
if (file.getName().endsWith(".tmp")) {
|
||||||
file.delete();
|
file.delete();
|
||||||
|
Loading…
Reference in New Issue
Block a user