Skip to content

Commit cba3bcb

Browse files
IsmaeelAlNajarGitHub Enterprise
authored andcommitted
SKA-989: Move to newly-generated C# classes (#184)
1 parent c1a70c3 commit cba3bcb

File tree

13 files changed

+9834
-9159
lines changed

13 files changed

+9834
-9159
lines changed

FmuImporter/FmiBridge/Binding/Fmi2Binding.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -718,10 +718,14 @@ public string[] GetString(uint[] valueReferences)
718718
{
719719
var str = Marshal.PtrToStringUTF8(resultRaw[i]);
720720

721-
result[i] = str ??
722-
throw new NativeCallException(
723-
$"Failed to retrieve data via {System.Reflection.MethodBase.GetCurrentMethod()?.Name ?? "(unknown method)"}. " +
724-
$"Exception thrown by the following value reference: {valueReferences[i]}");
721+
if (str == null)
722+
{
723+
throw new NativeCallException(
724+
$"Failed to retrieve data via {System.Reflection.MethodBase.GetCurrentMethod()?.Name ?? "(unknown method)"}. " +
725+
$"Exception thrown by the following value reference: {valueReferences[i]}");
726+
}
727+
728+
result[i] = str;
725729
}
726730

727731
return result;

0 commit comments

Comments
 (0)