Closed cstim closed 2 years ago
Thank you for the PR. I will merge it. Do you know what conditions led to reaching that spot in the code with a byteLength of NaN?
The conditions were not so clear, but we were surely causing a lot of data traffic due to high-load communication. There could be some timeouts from the PLC or similar, or also prematurely ending packets. We were experiencing crashes due to the NaN and got those fixed by this change here, so we did have no need to investigate the cause that led here. Thanks for merging.
Is it also possible to release this as a new version number? Then we wouldn't have to refer to a git commit in order to have this change. Thanks!
Done. Thanks.
When an item arrives to processS7Packet with a length equal to NaN, probably due to bad input, the library throws a non catchable error. The check added here prevents this catch from occurring by returning before attempting to allocate a Buffer of length NaN