Fix potential NPE for split CR/NL input #311