Only attempt lines trim if the list isn't empty
@ -106,6 +106,7 @@ def update_hosts_file():
break;
#remove all the trailing newlines on the line list
if lines:
while lines[-1].strip()=="": lines.pop()
#append all the domain lines