Fix buffers completion when there are some tabs with undefined title.

jh-changes
Kostyantyn Leschenko 7 years ago
parent 507c5b4f78
commit cc539d96bc
  1. 2
      src/background/tabs.js

@ -51,7 +51,7 @@ const selectByKeyword = (current, keyword) => {
const getCompletions = (keyword) => { const getCompletions = (keyword) => {
return browser.tabs.query({ currentWindow: true }).then((tabs) => { return browser.tabs.query({ currentWindow: true }).then((tabs) => {
let matched = tabs.filter((t) => { let matched = tabs.filter((t) => {
return t.url.includes(keyword) || t.title.includes(keyword); return t.url.includes(keyword) || t.title && t.title.includes(keyword);
}); });
return matched; return matched;
}); });