Adds null checks for getExternalCacheDir() and getExternalFilesDir()

Prevents crashes on Jelly Bean