[haiku-commits] Re: haiku: hrev51525 - src/apps/text_search

  • From: Jérôme Duval <jerome.duval@xxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 7 Nov 2017 16:48:41 +0100

2017-11-07 16:33 GMT+01:00 Philippe Houdoin <philippe.houdoin@xxxxxxxxx>:

* if (item != NULL)
* item is used in fSearchResults->IndexOf(item) whereas it is later
checked for NULL.

??

The new code checking for NULL :

ResultItem* item = fSearchResults->FindItem(ref, &index);
if (item) {
    item->SetText(path.String());
    // take care of invalidation, the index is currently
    // the full list index, but needs to be the visible
    // items index for this
    index = fSearchResults->IndexOf(item);
    fSearchResults->InvalidateItem(index);
}

I fail to see where it's later checked for NULL..


Right I misread the change. The check for NULL should nonetheless be
(item != NULL).

Bye,
Jérôme

Other related posts: