From 5bd5219308dc908021cf69a3b243c2b390375e11 Mon Sep 17 00:00:00 2001 From: David Hall Date: Sat, 27 Jan 2018 14:36:14 -0700 Subject: [PATCH] Bug fix on GetVarType --- PInvoke/Ole/Ole32/PropIdl.PROPVARIANT.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PInvoke/Ole/Ole32/PropIdl.PROPVARIANT.cs b/PInvoke/Ole/Ole32/PropIdl.PROPVARIANT.cs index 8eb87001..2776ee6a 100644 --- a/PInvoke/Ole/Ole32/PropIdl.PROPVARIANT.cs +++ b/PInvoke/Ole/Ole32/PropIdl.PROPVARIANT.cs @@ -574,14 +574,14 @@ namespace Vanara.PInvoke var isEnumerable = type.IsArray || type != typeof(string) && typeof(IEnumerable).IsAssignableFrom(type); var ret = isEnumerable ? VARTYPE.VT_VECTOR : 0; - if (isEnumerable && type.GetElementType() == null && type.IsGenericType) + if (isEnumerable && type.IsGenericType) { var i = type.GetInterface("IEnumerable`1"); if (i != null) { var args = i.GetGenericArguments(); if (args.Length == 1) - elemType = args[0]; + elemtype = args[0]; } } if (elemtype.IsNullable()) ret |= VARTYPE.VT_BYREF;