When reading small dbf files, it crashs even it could emit the 'error' event. I got some files created around 1995 with bytesOfHeader always 1025 bytes but the real file readable content size is just about a half of that.
Adding these guards will always enable the stream not to crash the node process in onData (convertToObject() needs non null stream.header.listOfFields array) event and able to 'end' after emitting 'error' event.
When reading small dbf files, it crashs even it could emit the 'error' event. I got some files created around 1995 with bytesOfHeader always 1025 bytes but the real file readable content size is just about a half of that.
Adding these guards will always enable the stream not to crash the node process in onData (convertToObject() needs non null stream.header.listOfFields array) event and able to 'end' after emitting 'error' event.