Skip to content

Commit

Permalink
Bugs fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
mauriciotogneri committed Jul 6, 2016
1 parent afd12e5 commit 1f98eba
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ android
applicationId "com.mauriciotogneri.fileexplorer"
minSdkVersion 14
targetSdkVersion 22
versionCode 3
versionName "1.0.3"
versionCode 4
versionName "1.0.4"
}

signingConfigs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public List<FileInfo> files()

if (isDirectory())
{
for (File currentFile : file.listFiles())
for (File currentFile : children())
{
if (currentFile != null)
{
Expand All @@ -61,7 +61,7 @@ public boolean delete()
{
if (isDirectory())
{
for (File currentFile : file.listFiles())
for (File currentFile : children())
{
if (currentFile != null)
{
Expand Down Expand Up @@ -196,14 +196,19 @@ public int numberOfChildren()
{
if (cachedNumberOfChildren == null)
{
File[] children = file.listFiles();

cachedNumberOfChildren = (children != null) ? children.length : 0;
cachedNumberOfChildren = children().length;
}

return cachedNumberOfChildren;
}

private File[] children()
{
File[] children = file.listFiles();

return (children != null) ? children : new File[0];
}

public String extension()
{
if (cachedExtension == null)
Expand Down

0 comments on commit 1f98eba

Please sign in to comment.