mkjeff/secs4net

when sending or receiving a '<L[0]>', `Item.Count` will throw an exception

fuquankim opened this issue · 1 comments

Describe the bug
when sending or receiving a '<L[0]>', Item.Count will throw an exception

To Reproduce
Steps to reproduce the behavior:

  1. For example, send a S1F13 CR as
S1F13_EstablishComm: S1F13 W
<L[0]
>
.
  1. in SmlExtension.ParseItem, Since <L[0]> is a none List, the method L() is called.
  2. in SmlExtension.Write, when executing the statement writer.Write(item.Count);, the item.Count will throw an exception :"system.entrypointnotfoundexception"

Desktop (please complete the following information):

  • OS: Windows 10 1909, 18363.900

Additional context
In item.Count, I add the following comparison to determine whether the _values is an empty item.

 if(_values == Enumerable.Empty<Item>())
 {
     return 0;
 } 

and then it works fine.
I have started to learn .net core since the last week, and I am wondering whether there is a better solution.

I had addressed the issue, but it is outdated in my plan.

Welcome to put your eyes on v2.