Skip to content
This repository has been archived by the owner on Aug 21, 2023. It is now read-only.

Commit

Permalink
avoid nullpointer
Browse files Browse the repository at this point in the history
  • Loading branch information
regnete committed May 29, 2018
1 parent 07ffde6 commit a26ddd0
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,10 @@ private void deleteRecursive(File f, boolean self)
private boolean canGetFile(String fileArg)
{
// TODO: better check for assets files ...
return fileArg.startsWith(ASSETS) || getFile(fileArg).exists();
if(fileArg.startsWith(ASSETS))
return true;
File f = getFile(fileArg);
return f != null && f.exists();
}

@SuppressLint("ObsoleteSdkInt")
Expand Down Expand Up @@ -797,7 +800,7 @@ private File getAccessibleFileOld(String fileArg)
else
{
File file = getFile(fileArg);
if (!file.exists() || !file.isFile())
if (file == null || !file.exists() || !file.isFile())
return null;

// detect private files, copy to accessible tmp dir if necessary
Expand Down

0 comments on commit a26ddd0

Please sign in to comment.