From 8556c9d7cf0cc23decc7f366b3f5ba138b5dd5f9 Mon Sep 17 00:00:00 2001 From: Michael Rybakin Date: Mon, 3 Jun 2024 18:10:19 +0400 Subject: [PATCH] =?UTF-8?q?fix=20#1405=20=D0=B4=D0=BB=D1=8F=20v2:=20=D0=B7?= =?UTF-8?q?=D0=BD=D0=B0=D1=87=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=B4=D0=BB=D1=8F?= =?UTF-8?q?=20=D0=BF=D1=80=D0=BE=D0=BF=D1=83=D1=89=D0=B5=D0=BD=D0=BD=D0=BE?= =?UTF-8?q?=D0=B3=D0=BE=20=D0=BF=D0=B0=D1=80=D0=B0=D0=BC=D0=B5=D1=82=D1=80?= =?UTF-8?q?=D0=B0=20+=D1=80=D0=B5=D1=84=D0=B0=D0=BA=D1=82=D0=BE=D1=80?= =?UTF-8?q?=D0=B8=D0=BD=D0=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Machine/Contexts/COMWrapperContext.cs | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/ScriptEngine/Machine/Contexts/COMWrapperContext.cs b/src/ScriptEngine/Machine/Contexts/COMWrapperContext.cs index 523896b67..7e049236d 100644 --- a/src/ScriptEngine/Machine/Contexts/COMWrapperContext.cs +++ b/src/ScriptEngine/Machine/Contexts/COMWrapperContext.cs @@ -150,21 +150,14 @@ protected static (object[] values, ParameterModifier[] flags) MarshalArguments(I public static object MarshalIValue(IValue val) { object retValue; - if (val != null && val is BslDateValue dateVal) + if (val is BslDateValue dateVal) { var date = (DateTime)dateVal; - if (date <= MIN_OLE_DATE) - { - retValue = MIN_OLE_DATE; - } - else - { - retValue = date; - } + retValue = date < MIN_OLE_DATE ? MIN_OLE_DATE : date; } else { - retValue = ContextValuesMarshaller.ConvertToClrObject(val); + retValue = ContextValuesMarshaller.ConvertToClrObject(val) ?? Missing.Value;; } return retValue;