if [[ -z "$last_line" ]]
This -z test will check if the variable is completely empty. It depends how you define empty though.
To do not empty you can just cancel this or add an else.
if [[ ! -z "$last_line" ]]