fix null ref crash on stdin input

Signed-off-by: Greg Dietsche <Gregory.Dietsche@cuw.edu>