Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LatinIME
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
keyboard
LatinIME
Commits
86da47e8
Commit
86da47e8
authored
11 years ago
by
Keisuke Kuroyanagi
Browse files
Options
Downloads
Patches
Plain Diff
Fix possible NPE in FileUtils.
Change-Id: I503f91e266c71e2370a5807d171e2254c334f7cb
parent
6bca9ac4
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
java/src/com/android/inputmethod/latin/utils/FileUtils.java
+8
-2
8 additions, 2 deletions
java/src/com/android/inputmethod/latin/utils/FileUtils.java
with
8 additions
and
2 deletions
java/src/com/android/inputmethod/latin/utils/FileUtils.java
+
8
−
2
View file @
86da47e8
...
...
@@ -25,8 +25,11 @@ import java.io.FilenameFilter;
public
class
FileUtils
{
public
static
boolean
deleteRecursively
(
final
File
path
)
{
if
(
path
.
isDirectory
())
{
for
(
final
File
child
:
path
.
listFiles
())
{
deleteRecursively
(
child
);
final
File
[]
files
=
path
.
listFiles
();
if
(
files
!=
null
)
{
for
(
final
File
child
:
files
)
{
deleteRecursively
(
child
);
}
}
}
return
path
.
delete
();
...
...
@@ -37,6 +40,9 @@ public class FileUtils {
return
false
;
}
final
File
[]
files
=
dir
.
listFiles
(
fileNameFilter
);
if
(
files
==
null
)
{
return
false
;
}
boolean
hasDeletedAllFiles
=
true
;
for
(
final
File
file
:
files
)
{
if
(!
deleteRecursively
(
file
))
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment