1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-26 17:03:12 +03:00

fix: make /search with no results field work again

This commit is contained in:
Timo Kösters
2021-04-18 14:01:58 +02:00
parent cbe9b59222
commit 069ca4a89d

View File

@@ -4799,7 +4799,8 @@ MatrixClient.prototype._processRoomEventsSearch = function(searchResults, respon
searchResults.highlights = Object.keys(highlights);
// append the new results to our existing results
for (let i = 0; i < room_events.results.length; i++) {
const resultsLength = room_events.results ? room_events.results.length : 0;
for (let i = 0; i < resultsLength; i++) {
const sr = SearchResult.fromJson(room_events.results[i], this.getEventMapper());
searchResults.results.push(sr);
}