From a6600997b13d6f6002e491c8463b38cdeb788450 Mon Sep 17 00:00:00 2001 From: Solomon Foster Date: Tue, 12 Jun 2012 06:57:49 -0400 Subject: [PATCH] Handle null strings returned from CLR using sorear++'s suggestion. --- lib/NieczaCLR.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/NieczaCLR.cs b/lib/NieczaCLR.cs index ec7240ec..ffc51be3 100644 --- a/lib/NieczaCLR.cs +++ b/lib/NieczaCLR.cs @@ -788,7 +788,7 @@ public class CLRWrapperProvider { if (cty == typeof(bool)) return Kernel.BoxAnyMO((bool)ret, Kernel.BoolMO); if (cty == typeof(string)) - return Kernel.BoxAnyMO((string)ret, Kernel.StrMO); + return ret == null ? Kernel.StrMO.typeObj : Kernel.BoxAnyMO((string)ret, Kernel.StrMO); if (cty == typeof(Variable)) return (Variable)ret; if (cty == typeof(P6any))