why don't you check startline AND endline against None?