Add null check to SQLiteConnectionPool.dump()
This change adds a null check before adding the current connection pool path's parent to the list of directories, since the parent might be null. This avoids an NPE in SQLiteDatabase.dumpAll(). Test: run dumpsys dbinfo, verify that it no longer times out Bug: 281043011 Change-Id: Iec7fa9d0941d79dfa034f117c35c30797c7d3113
This commit is contained in:
@@ -1136,7 +1136,10 @@ public final class SQLiteConnectionPool implements Closeable {
|
||||
Printer indentedPrinter = PrefixPrinter.create(printer, " ");
|
||||
synchronized (mLock) {
|
||||
if (directories != null) {
|
||||
directories.add(new File(mConfiguration.path).getParent());
|
||||
String parent = new File(mConfiguration.path).getParent();
|
||||
if (parent != null) {
|
||||
directories.add(parent);
|
||||
}
|
||||
}
|
||||
boolean isCompatibilityWalEnabled = mConfiguration.isLegacyCompatibilityWalEnabled();
|
||||
printer.println("Connection pool for " + mConfiguration.path + ":");
|
||||
|
||||
Reference in New Issue
Block a user