Skip to content

Commit

Permalink
fix !== null not include undefined bug
Browse files Browse the repository at this point in the history
  • Loading branch information
zmcx16 committed Feb 21, 2020
1 parent ba9d280 commit c8ba956
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/execute.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ function getID(html_data) {
var match_url = html_data.outerHTML.match(urlRegex);
if (match_url) {
var id = match_url[1].substring(match_url[1].lastIndexOf("\/") + 1);
if (id !== null){
if (id !== null && id !== undefined){
return id;
}
}
Expand All @@ -242,7 +242,7 @@ function getIDList(data) {
try {
for (var i = 0; i < data.length; i++) {
var id = getID(data[i]);
if (id !== null){
if (id !== null && id !== undefined){
output.push(id);
}
}
Expand Down Expand Up @@ -424,7 +424,7 @@ function updateUIContentChange() {
var id = getID(data[j]);

// hidden & star button
if (tgt_element !== null && tgt_element.innerHTML.indexOf('icon-text-btn') === -1 && tgt_element.innerHTML.indexOf('title_list') != -1) {
if (tgt_element !== null && tgt_element !== undefined && tgt_element.innerHTML.indexOf('icon-text-btn') === -1 && tgt_element.innerHTML.indexOf('title_list') != -1) {

tgt_element.style.position = 'relative';
tgt_element.innerHTML =
Expand Down

0 comments on commit c8ba956

Please sign in to comment.