When you read a line, it will never be null until it reaches the end of the data. If there's no data in the line, it will just be an empty string instead.
You haven't shown enough code to explain why you're getting a NullPointerException, but you really need to understand that you won't see any "null values" before reaching the end of the data.
To work out why you're getting a NullPointerException:
- Look at the line indicated in the stack trace
- Identify every dereferencing operation
- Either put a breakpoint on that line, or add some logging, or split the line into multiple statements so that each statement only has a single dereferencing operation
That should let you work out exactly which value is null, causing the exception to be thrown. What you need to do to fix it will depend on what you're trying to do and which value is null - we don't have enough information to help you on that front at the moment.