Daniel Martí 1a94c46e87 Fix NPE crash when clearing files in a directory
This was very probably introduced with the new CleanCacheService stuff.
Reported via ACRA:

	ANDROID_VERSION=6.0.1
	APP_VERSION_NAME=0.100-alpha6
	STACK_TRACE=java.lang.NullPointerException: Attempt to get length of null array
		at org.fdroid.fdroid.Utils.clearOldFiles(Utils.java:349)
		at org.fdroid.fdroid.Utils.clearOldFiles(Utils.java:351)
		at org.fdroid.fdroid.Utils.clearOldFiles(Utils.java:351)
		at org.fdroid.fdroid.CleanCacheService.onHandleIntent(CleanCacheService.java:54)
		at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:66)
		at android.os.Handler.dispatchMessage(Handler.java:102)
		at android.os.Looper.loop(Looper.java:148)
		at android.os.HandlerThread.run(HandlerThread.java:61)

There is nothing to clear if the directory could not be obtained for
some reason, so this seems like a reasonable fix. Anything is better
than a crash anyway.
2016-05-07 22:30:31 +01:00
..
2016-05-03 11:36:57 +01:00