check getLine result against 'undefined' instead of 'null'