From 8ec0ce68f79f0e737bf4fc710a41e8726b468a2e Mon Sep 17 00:00:00 2001 From: Antoine Goutenoir Date: Tue, 3 Dec 2019 14:11:56 +0100 Subject: [PATCH] Improve robustness of input addresses reading. --- flaskr/controllers/main_controller.py | 3 +++ 1 file changed, 3 insertions(+), 0 deletions(-) diff --git a/flaskr/controllers/main_controller.py b/flaskr/controllers/main_controller.py index 4670d48..cb0da6f 100644 --- a/flaskr/controllers/main_controller.py +++ b/flaskr/controllers/main_controller.py @@ -131,6 +131,9 @@ def gather_addresses(from_list, from_file): else: addresses = from_list.replace("\r", '').split("\n") + # Remove empty lines (if any) + addresses = [a for a in addresses if a] + return "\n".join(addresses) -- libgit2 0.21.2