TextSearch: avoid calling ChangesIterator's method when null

Fixes #9874
This commit is contained in:
Philippe Houdoin 2017-11-07 14:35:25 +01:00
parent 653c767602
commit ce04a43add

View File

@ -815,9 +815,11 @@ GrepWindow::_OnNodeMonitorEvent(BMessage* message)
BString path;
if (message->FindString("path", &path) == B_OK) {
if (opCode == B_ENTRY_CREATED)
if (fChangesIterator)
fChangesIterator->EntryAdded(path.String());
else {
// in order to remove temporary files
if (fChangesIterator)
fChangesIterator->EntryRemoved(path.String());
// remove from the list view already
BEntry entry(path.String());
@ -889,6 +891,7 @@ GrepWindow::_OnNodeMonitorEvent(BMessage* message)
// file.
BString path;
if (message->FindString("path", &path) == B_OK) {
if (fChangesIterator)
fChangesIterator->EntryChanged(path.String());
} else {
#ifdef TRACE_NODE_MONITORING