bug fix for "current_domain is null" Rated 3 out of 5 stars

Add an if condition after current_domain variable declaration.

var current_domain = document.location.href.match(/^https?:\/\/(?:www\.)?([^\.]+\.[^\/]+)/i);
if(current_domain!==null){
//start of for loop
....
//end of for loop
}