Skip to content

Commit 0f001d3

Browse files
committed
Try to avoid possible NPE
For some reason .getParent() appears to be returning null for a data directory. We don't need to use the parent; we can just use the path. Bug: 7151733 Change-Id: I5e17cc14fe53669882329d67d8a7b4ec35b81104
1 parent 568e3eb commit 0f001d3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

services/java/com/android/server/pm/PackageManagerService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4108,7 +4108,7 @@ private PackageParser.Package scanPackageLI(PackageParser.Package pkg,
41084108
}
41094109
} else if (!isForwardLocked(pkg) && !isExternal(pkg)) {
41104110
// Update native library dir if it starts with /data/data
4111-
if (nativeLibraryDir.getParent().startsWith(dataPathString)) {
4111+
if (nativeLibraryDir.getPath().startsWith(dataPathString)) {
41124112
setInternalAppNativeLibraryPath(pkg, pkgSetting);
41134113
nativeLibraryDir = new File(pkg.applicationInfo.nativeLibraryDir);
41144114
}

0 commit comments

Comments
 (0)