Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 68304252 authored by Kevin Jeon's avatar Kevin Jeon
Browse files

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
parent a3b93dcc
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -1136,7 +1136,10 @@ public final class SQLiteConnectionPool implements Closeable {
        Printer indentedPrinter = PrefixPrinter.create(printer, "    ");
        Printer indentedPrinter = PrefixPrinter.create(printer, "    ");
        synchronized (mLock) {
        synchronized (mLock) {
            if (directories != null) {
            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();
            boolean isCompatibilityWalEnabled = mConfiguration.isLegacyCompatibilityWalEnabled();
            printer.println("Connection pool for " + mConfiguration.path + ":");
            printer.println("Connection pool for " + mConfiguration.path + ":");