From 424a3f3680aa51093394721bb78802e389328174 Mon Sep 17 00:00:00 2001 From: Michael Zillgith Date: Sun, 15 Mar 2015 14:05:23 +0100 Subject: [PATCH] - fixed problem in C# MmsValue --- dotnet/IEC61850forCSharp/MmsValue.cs | 6 +++++- dotnet/IEC61850forCSharp/ReportControlBlock.cs | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/dotnet/IEC61850forCSharp/MmsValue.cs b/dotnet/IEC61850forCSharp/MmsValue.cs index a9fa22f3..c545fcaa 100644 --- a/dotnet/IEC61850forCSharp/MmsValue.cs +++ b/dotnet/IEC61850forCSharp/MmsValue.cs @@ -336,7 +336,11 @@ namespace IEC61850 if ((type == MmsType.MMS_ARRAY) || (type == MmsType.MMS_STRUCTURE)) { if ((index >= 0) && (index < Size ())) { IntPtr value = MmsValue_getElement (valueReference, index); - return new MmsValue (value); + + if (value == IntPtr.Zero) + return null; + else + return new MmsValue (value); } else throw new MmsValueException ("Index out of bounds"); } else diff --git a/dotnet/IEC61850forCSharp/ReportControlBlock.cs b/dotnet/IEC61850forCSharp/ReportControlBlock.cs index 86a9ed6c..e23e56c4 100644 --- a/dotnet/IEC61850forCSharp/ReportControlBlock.cs +++ b/dotnet/IEC61850forCSharp/ReportControlBlock.cs @@ -202,7 +202,7 @@ namespace IEC61850 try { if (this.report == null) - this.report = new Report (report); + this.report = new Report (report); if (reportHandler != null) reportHandler(this.report, reportHandlerParameter);