Merge pull request #222 from kleschenko/fix_buffers_completion

Fix buffers completion when there are some tabs with undefined title.
This commit is contained in:
Shin'ya Ueoka 2017-11-29 18:35:35 +09:00 committed by GitHub
commit 8361b70d0b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;
}); });