Skip to content

Commit 44935c2

Browse files
cco3Android Code Review
authored andcommitted
Merge "Fix for startup NPE."
2 parents 17ba30b + 5c14d32 commit 44935c2

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

services/java/com/android/server/UsbObserver.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,9 @@ private final void init() {
128128

129129
try {
130130
File[] files = new File(USB_COMPOSITE_CLASS_PATH).listFiles();
131+
if (files == null) {
132+
return; // nothing to do
133+
}
131134
for (int i = 0; i < files.length; i++) {
132135
File file = new File(files[i], "enable");
133136
FileReader reader = new FileReader(file);

0 commit comments

Comments
 (0)