check for null and undefined

This commit is contained in:
Mark Beamer Jr 2019-05-31 22:02:00 -04:00
parent 4056fb86cf
commit 3a061df1a4
No known key found for this signature in database
GPG key ID: 1C314FB89AD76973

View file

@ -477,7 +477,9 @@ class LighthouseControllers {
if (name.indexOf(ctx.query.s.trim()) > -1 && name.indexOf('http') === -1) {
cResults.push(name);
}
if (pResult._source.value && pResult._source.value.stream !== undefined) {
if (pResult._source.value &&
pResult._source.value.stream &&
pResult._source.value.stream !== undefined){
var title = pResult._source.value.stream.metadata.title;
var author = pResult._source.value.stream.metadata.author;
if (title.indexOf(ctx.query.s.trim()) > -1 && title.indexOf('http') === -1) {