Deserialization into simple char causes System.IndexOutOfRangeException · Issue #227 · rpgmaker/NetJSON · GitHub
Skip to content

Deserialization into simple char causes System.IndexOutOfRangeException #227

Description

@Micke90s

Hallo,

could you please check the following behavior?

I tried to update NetJSON from 1.2.1.8 (I am not absolute sure about the version. It also could be older) to the current version. Unfortunately I got the problem that the existing classes causing the exception “System.IndexOutOfRangeException” when char is used as attribute.

  public class CNTL_SIMPLE_EVENT {
    public int EVENTID;
    //public String APPL_EVENT; //Works perfect
    public char APPL_EVENT; //Causes Exception
  }
  class Program  {
    static void Main(string[] args)    {
      var json = "{\"EVENTID\":19 ,\"APPL_EVENT\":\"\"}";
      var simple = NetJSON.NetJSON.Deserialize<CNTL_SIMPLE_EVENT>(json);
    }
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions