fix: crash on blank title

This commit is contained in:
Thomas Zarebczan 2019-06-06 12:02:43 -04:00
parent 1b98a13082
commit 5c8d3b4143
2 changed files with 12 additions and 8 deletions

10
dist/bundle.es.js vendored
View file

@ -2270,10 +2270,12 @@ const selectSearchDownloadUris = query => reselect.createSelector(selectFileInfo
return;
}
const titleParts = title.toLowerCase().split(' ');
if (arrayContainsQueryPart(titleParts)) {
downloadResultsFromQuery.push(fileInfo);
return;
if (title) {
const titleParts = title.toLowerCase().split(' ');
if (arrayContainsQueryPart(titleParts)) {
downloadResultsFromQuery.push(fileInfo);
return;
}
}
if (author) {

View file

@ -164,10 +164,12 @@ export const selectSearchDownloadUris = query =>
return;
}
const titleParts = title.toLowerCase().split(' ');
if (arrayContainsQueryPart(titleParts)) {
downloadResultsFromQuery.push(fileInfo);
return;
if (title) {
const titleParts = title.toLowerCase().split(' ');
if (arrayContainsQueryPart(titleParts)) {
downloadResultsFromQuery.push(fileInfo);
return;
}
}
if (author) {