The local variable cacheDir may not have been initialized, and we're using it later at line 384 without checking for null value.