From ce04a43add777e0c8dab2ad6c8d3a6a4fbe791f4 Mon Sep 17 00:00:00 2001 From: Philippe Houdoin Date: Tue, 7 Nov 2017 14:35:25 +0100 Subject: [PATCH] TextSearch: avoid calling ChangesIterator's method when null Fixes #9874 --- src/apps/text_search/GrepWindow.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/apps/text_search/GrepWindow.cpp b/src/apps/text_search/GrepWindow.cpp index 97683b0ff3..a6a52e964c 100644 --- a/src/apps/text_search/GrepWindow.cpp +++ b/src/apps/text_search/GrepWindow.cpp @@ -815,10 +815,12 @@ GrepWindow::_OnNodeMonitorEvent(BMessage* message) BString path; if (message->FindString("path", &path) == B_OK) { if (opCode == B_ENTRY_CREATED) - fChangesIterator->EntryAdded(path.String()); + if (fChangesIterator) + fChangesIterator->EntryAdded(path.String()); else { // in order to remove temporary files - fChangesIterator->EntryRemoved(path.String()); + if (fChangesIterator) + fChangesIterator->EntryRemoved(path.String()); // remove from the list view already BEntry entry(path.String()); entry_ref ref; @@ -889,7 +891,8 @@ GrepWindow::_OnNodeMonitorEvent(BMessage* message) // file. BString path; if (message->FindString("path", &path) == B_OK) { - fChangesIterator->EntryChanged(path.String()); + if (fChangesIterator) + fChangesIterator->EntryChanged(path.String()); } else { #ifdef TRACE_NODE_MONITORING printf("incompatible message:\n");