Return nil if the line is nil

This is to fix an issue where it throws an error is the line is nil. In the original code, if line is nil it will error out saying no method split for NilClass