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

Commit a8a3f565 authored by Ghouse Hajimad's avatar Ghouse Hajimad Committed by Mattias Nilsson
Browse files

Fix NPE of NativeTombstoneManager.TombstoneWatcher

Root Cause:
"path" argument of FileObserver.onEvent(event, path) can be null,
but there is no null check in NativeTombstoneManager.TombstoneWatcher.

Solution:
Do nothing when path is null

Bug: 301410299
Test: manual (check native crash dump behavior)
Change-Id: I92ee2ddd0a844e9150ca851f0d94f60f4a20e68f
parent 53565bfd
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -560,6 +560,10 @@ public final class NativeTombstoneManager {

        @Override
        public void onEvent(int event, @Nullable String path) {
            if (path == null) {
                Slog.w(TAG, "path is null at TombstoneWatcher.onEvent()");
                return;
            }
            mHandler.post(() -> {
                handleTombstone(new File(TOMBSTONE_DIR, path));
            });