From 74fa987b9e7f3e494f275c53e29e28152e0276a7 Mon Sep 17 00:00:00 2001 From: Peter McConnell Date: Mon, 27 Apr 2020 20:26:00 +0100 Subject: [PATCH] Only attempt lines trim if the list isn't empty --- hoster.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hoster.py b/hoster.py index 9f634bc..d87448a 100644 --- a/hoster.py +++ b/hoster.py @@ -106,7 +106,8 @@ def update_hosts_file(): break; #remove all the trailing newlines on the line list - while lines[-1].strip()=="": lines.pop() + if lines: + while lines[-1].strip()=="": lines.pop() #append all the domain lines if len(hosts)>0: