mirror of
https://github.com/S7NetPlus/s7netplus.git
synced 2026-02-17 22:38:27 +08:00
This requires reference types that can be null to be annotated by a ? operator, similar to value types. This gives the advantage that the compiler can warn against any null dereference exceptions, of which this commits elimits a few. To make the underlying protocol implementation not any more complicated and to eliminate existing problems, and not that precise error reporting, I replaced some return null statements with explicit Exceptions. This lead to the assumption that those core protocoll functions always return non-null objects if they do not throw, making the PLC code simpler. Adjust some NotConnected tests to look for explicit PlcException instead of NullReferenceException.