Fix a NPE in the text search callback code